public void Delete(T entity) { _dbSet.Attach(entity); _context.Entry(entity).State = EntityState.Deleted; //_dbSet.Remove(entity); }
public void Update(T entity) { _dbSet.Attach(entity); _context.Entry(entity).State = EntityState.Modified; }