S
shapper
Hello,
I am updating a User entity as follows:
public void Update(User user) {
ISession session = new AppContext();
UserRepository repository = new UserRepository(session);
User _user = repository.GetById(user.Id);
_user = user;
session.Commit();
} // Update
I am not sure the fields will work. User is something like:
public class User {
public int Id { get; set; }
public string Name { get; set; }
public List<Role> Roles { get; set; }
public List<String> Emails { get; set; }
}
I would like to update the properties in _user which values are
different from user.
What is the best way to do this?
Thanks,
Miguel
I am updating a User entity as follows:
public void Update(User user) {
ISession session = new AppContext();
UserRepository repository = new UserRepository(session);
User _user = repository.GetById(user.Id);
_user = user;
session.Commit();
} // Update
I am not sure the fields will work. User is something like:
public class User {
public int Id { get; set; }
public string Name { get; set; }
public List<Role> Roles { get; set; }
public List<String> Emails { get; set; }
}
I would like to update the properties in _user which values are
different from user.
What is the best way to do this?
Thanks,
Miguel