public void Update(User entity) { User user = _context.Find <User>(entity.Id); user.FirstName = entity.FirstName; user.LastName = entity.LastName; user.Username = entity.Username; user.Password = entity.Password; user.Notes = entity.Notes; _context.Update(user); }
public void Update(int userId) { User user = _context.Set <User>() .Include(u => u.Notes) .Single(u => u.Id == userId); user.FirstName = entity.FirstName; user.LastName = entity.LastName; user.Username = entity.Username; user.Password = entity.Password; user.Notes = entity.Notes; _context.Update(user); }
public void Update(User entity) { User user = _context.Set <User>() .Include(u => u.Notes) .SingleOrDefault(u => u.Username == entity.Username); user.Id = entity.Id; user.FirstName = entity.FirstName; user.LastName = entity.LastName; user.Username = entity.Username; user.Password = entity.Password; user.Notes = entity.Notes; _context.Update(user); }
public void Update(Note entity) { _context.Update(entity); }