Exemple #1
0
        public async Task <ViewResult> Product(string productName, string returlUrl = null)
        {
            if (!string.IsNullOrEmpty(productName))
            {
                var products = await _streinger.Goods(productName);

                if (products != null && products.Count() != 0)
                {
                    IProduct firstProd     = products.First();
                    var      prodViewModel = new ProductViewModel()
                    {
                        Comments        = _recommendator.CommentsTo(firstProd),
                        Product         = firstProd,
                        Products        = products,
                        Recommendations = _recommendator.RecommendationsTo(firstProd)
                    };

                    return(View(prodViewModel));
                }
            }

            return(View());
        }