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)); }
public CustomerBasket(CustomerBasket customerBasket) { this.CustomerId = customerBasket.CustomerId; this.Items = customerBasket.Items; }
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)); }