Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Should service layer methods expect instance or id

$
0
0

for example if I'd like to update something should I create a method like:

Update(SomeEntity entity)

in my service layer, so in my controller I have 1 call to get the entity and 2nd call to update it?

or service method should expect id everywhere?

Update(int entityId, SomeEntity toupdate)


Viewing all articles
Browse latest Browse all 9386

Trending Articles