Пример #1
0
        private async Task DeletePersistedCart(Cart persistedCart)
        {
            List <Item> persistedItems = (await _itemService.AllByCartIdAsync(persistedCart.Id)).ToList();

            foreach (var item in persistedItems)
            {
                await _itemService.DeleteAsync(item);
            }

            this.Repository.Delete(persistedCart);
            await this.Repository.SaveChangesAsync();
        }