What if I have an object with a 100 properties that changed?
This would be horrible to code and prone to missing some properties.
Is there a different way of updating a record than to do it manually?
ApplicationUser CurrentUser = db.Users.FirstOrDefault(x => x.Id == model.Id);
CurrentUser.FirstName = model.FirstName;
CurrentUser.LastName = model.LastName;
CurrentUser.IsRSM = model.IsRSM;
CurrentUser.PhoneNumber = model.PhoneNumber;
CurrentUser.Email = model.Email;
CurrentUser.UserName = model.Email;
CurrentUser.Region = model.Region;
CurrentUser.Active = model.Active;
db.Entry(CurrentUser).State = System.Data.Entity.EntityState.Modified;
db.SaveChanges();