Exemplo n.º 1
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            // Get cookie
            var model = await _basketOrchestrator.GetBasket();

            return(View("../Basket/Header/Default", model));
        }
        private async Task <int> GetBasketItemCount()
        {
            var basket = await _orchestrator.GetBasket();

            if (basket.Items == null)
            {
                return(0);
            }

            return(basket.Items.Count + basket.Items.Where(x => x.TrainingProvider != null).SelectMany(x => x.TrainingProvider).Count());
        }