public UserModel() { User = new User(); UserRoleIds = new List<int>(); AvailableRoles = new List<Role>(); }
public User UpdateUser(User user) { var entity = UnitOfWork.Users.GetById(user.Id); entity.Discount = user.Discount; entity.EmailAddress = user.EmailAddress; entity.Name = user.Name; entity.IsActive = user.IsActive; UnitOfWork.Users.Update(entity); UnitOfWork.Commit(); return user; }