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);
        }
Пример #2
0
 public void Update(User user)
 {
     _context.Entry(user).State = EntityState.Modified;
 }
Пример #3
0
 public async void   Update <T>(T entity) where T : class
 {
     _context.Entry(entity).State = EntityState.Modified;
     await _context.SaveChangesAsync();
 }