Пример #1
0
 public void Delete(T entity)
 {
     _dbSet.Attach(entity);
     _context.Entry(entity).State = EntityState.Deleted;
     //_dbSet.Remove(entity);
 }
Пример #2
0
 public void Update(T entity)
 {
     _dbSet.Attach(entity);
     _context.Entry(entity).State = EntityState.Modified;
 }