I have a prop List<User> Users and I want to get the User that has the specified id without getting the reference to it.
In UserDAO:
public User ReturnUser(int id)
{
var q = this.Users.Where(x => x.Id == id);
return q.ToList()[0];
}
In main:
User newUser = ud.ReturnUser(0);
Console.WriteLine(newUser.Name);
newUser.Name = "john";
Console.WriteLine(ud.Users[0].Name);