Exemplo n.º 1
0
        public virtual void Delete(TEntity entityToDelete)
        {
            if (_context.Entry(entityToDelete).State == EntityState.Detached)
            {
                _dbSet.Attach(entityToDelete);
            }

            _dbSet.Remove(entityToDelete);
        }
Exemplo n.º 2
0
 public async Task UpdateAsync(T objectValue)
 {
     Context.Entry(objectValue).State = EntityState.Modified;
     await Context.SaveChangesAsync();
 }