Esempio n. 1
0
        public GetFeaturedProductsResponse GetFeaturedProducts()
        {
            var response = new GetFeaturedProductsResponse();

            var query = new Query <ProductTitle>(pt => true)
                        .OrderBy(new OrderByClause <ProductTitle>(pt => pt.Price, true));

            response.Products = _productTitleRepository.FindBy(query, 0, 6).ToProductSummaryView();

            return(response);
        }
Esempio n. 2
0
        public GetFeaturedProductsResponse GetFeaturedProducts()
        {
            GetFeaturedProductsResponse response = new GetFeaturedProductsResponse();

            Query productQuery = new Query();

            productQuery.OrderByProperty = new OrderByClause()
            {
                Desc = true, PropertyName = PropertyNameHelper.ResolvePropertyName <ProductTitle>(pt => pt.Price)
            };

            response.Products = _productTitleRepository.FindBy(productQuery, 0, 6).ConvertToProductViews();

            return(response);
        }
        public GetProductResponse GetProduct(GetProductRequest request)
        {
            GetProductResponse response     = new GetProductResponse();
            ProductTitle       productTitle = _productTitleRepository.FindBy(request.ProductId);

            response.Product = _mapper.Map <ProductTitle, ProductView>(productTitle);

            return(response);
        }