Esempio n. 1
0
        public async Task <ActionResult <Basket> > AddToBasket([FromBody] BasketItem basketItem)
        {
            var item   = basketItem.ToBasketItemModel();
            var basket = await _basketsRepository.AddToBasketAsync(item);

            return(basket.ToBasketViewModel());
        }
Esempio n. 2
0
        public async Task <Basket> AddToBasketAsync(BasketItem item)
        {
            var basket = await basketsRepository.AddToBasketAsync(item);

            return(await calcEngineService.CalculateTotals(basket));
        }