/// <summary> /// Update the database with new user information /// </summary> /// <param name="user"></param> public void UpdateUser(User user) { var oldEntity = _context.Users.Find(user.UserID); var updatedEntity = Mapper.MapUsers(user); _context.Entry(oldEntity).CurrentValues.SetValues(updatedEntity); }
public void UpdateComment(Comment newComment) { var newEntity = Mapper.MapComments(newComment); var oldEntity = _context.Comments.Find(newComment.CommentId); _context.Entry(oldEntity).CurrentValues.SetValues(newEntity); }