C#C
C#16mo ago
FraznoFire

Return Value on Entity Modification

Hi everyone, I'm creating a class library that contains my entity framework models and surrounding business logic for my project. I am creating a method for modifying one property of my entity. I am wondering if it is best practice to have this method return the entire object, a bool for success/fail, the changed value, or nothing.

My thinking is that since the method is being passed a reference to the entity stored in the database, I shouldn't have to return the full entity as the change has been saved, but I just don't know what sort of standard to apply in my code and if it will have any negative cosequences in the future of the codebase.
Was this page helpful?