public void UpdateComment(Comment comment) { var e = _context.Comments.Where(x => x.PostId == comment.PostId).First(y => y.Id == comment.Id); _context.Entry(e).CurrentValues.SetValues(comment); }
public void Update(User user) { _context.Entry(user).State = EntityState.Modified; }
public async void Update <T>(T entity) where T : class { _context.Entry(entity).State = EntityState.Modified; await _context.SaveChangesAsync(); }