示例#1
0
        public virtual Task <SearchCartResponse> Handle(SearchWishlistQuery request, CancellationToken cancellationToken)
        {
            var searchCriteria = new CartSearchCriteriaBuilder(_searchPhraseParser, _mapper)
                                 .WithCurrency(request.CurrencyCode)
                                 .WithStore(request.StoreId)
                                 .WithType(XPurchaseConstants.ListTypeName)
                                 .WithLanguage(request.CultureName)
                                 .WithCustomerId(request.UserId)
                                 .WithPaging(request.Skip, request.Take)
                                 .WithSorting(request.Sort)
                                 .WithResponseGroup(CartResponseGroup.WithLineItems)
                                 .Build();

            return(_cartAggregateRepository.SearchCartAsync(searchCriteria));
        }
        public virtual Task <SearchCartResponse> Handle(SearchCartQuery request, CancellationToken cancellationToken)
        {
            var searchCriteria = new CartSearchCriteriaBuilder(_searchPhraseParser, _mapper)
                                 .ParseFilters(request.Filter)
                                 .WithCurrency(request.CurrencyCode)
                                 .WithStore(request.StoreId)
                                 .WithType(request.CartType)
                                 .WithLanguage(request.CultureName)
                                 .WithCustomerId(request.UserId)
                                 .WithPaging(request.Skip, request.Take)
                                 .WithSorting(request.Sort)
                                 .Build();

            searchCriteria.ResponseGroup = EnumUtility.SafeParseFlags(request.GetResponseGroup(), CartResponseGroup.Full).ToString();
            return(_cartAggregateRepository.SearchCartAsync(searchCriteria));
        }