public async Task <CustomerBasket> UpdateBasketAsync(CustomerBasket basket)
        {
            var created = await _database.StringSetAsync(basket.BuyerId, JsonConvert.SerializeObject(basket));

            if (!created)
            {
                _logger.LogInformation("Problem occur persisting the item.");
                return(null);
            }

            _logger.LogInformation("Basket item persisted succesfully.");

            return(await GetBasketAsync(basket.BuyerId));
        }
示例#2
0
 public CustomerBasket(CustomerBasket customerBasket)
 {
     this.CustomerId = customerBasket.CustomerId;
     this.Items      = customerBasket.Items;
 }
示例#3
0
 public UpdateQuantityOutput(BasketItem basketItem, CustomerBasket customerBasket)
 {
     BasketItem     = basketItem;
     CustomerBasket = customerBasket;
 }
        public async Task <CustomerBasket> UpdateBasketAsync(CustomerBasket basket)
        {
            await database.StringSetAsync(basket.CustomerId, JsonConvert.SerializeObject(basket));

            return(await GetBasketAsync(basket.CustomerId));
        }