public async Task <BasketWithPrice> GetUsersBasketWithItemsAndDiscounts() { var usersId = _currentUserProvider.GetId(); var basketWithoutPrice = await _queries.GetUsersBasket(usersId, d => d.Add(b => b.Items).Add("Items.Product")); if (basketWithoutPrice == null) { throw new ModelNotFoundException("Users basket not found."); } if (_basketCache.IsValid(basketWithoutPrice.Id)) { return(await _basketCache.Get(basketWithoutPrice.Id)); } else { var basketWithPrice = await _basketService.CalculatePrice(basketWithoutPrice); await _basketCache.Set(basketWithPrice); return(basketWithPrice); } }