Esempio n. 1
0
        public Task DeleteAsync(int id)
        {
            var entityToDelete = GetByIdAsync(id);

            _context.Remove(entityToDelete);
            return(Task.CompletedTask);
        }
Esempio n. 2
0
        public async Task <bool> DeleteBasketAsync(string basketId)
        {
            var basket = await _context.Set <Basket>().FindAsync(basketId);

            if (basket == null)
            {
                return(false);
            }
            _context.Remove(basket);
            await _context.SaveChangesAsync();

            return(true);
        }
 public void DeleteEntity(T entity)
 {
     _context.Remove <T>(entity);
 }