KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is it acceptable practice to pass an object into a method, then return the same object rather than creating a new object inside of the method itself? As an example: if have an entity class as follows: class UserDetails { int UserID { get; set; } string UserName { get; set; } string UserAge { get; set; } } And then I pass an instance of this class to a method, as follows: UserDetails UserInfo = new UserDetails(); UserInfo = Get_Details(UserInfo); Is it reasonable for the method to do the following? public UserDetails Get_Details(UserDetails user) { // SQL Operations... user.age = 32; return user; }
Tags (comma-separated)
Save Edits
Cancel