public Task DeleteAsync(int id) { var entityToDelete = GetByIdAsync(id); _context.Remove(entityToDelete); return(Task.CompletedTask); }
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); }