示例#1
0
        public IActionResult Index(string productName)
        {
            var model = _productWebService.GetProductByProductName(productName);

            model.Cart  = GetCart();
            model.Login = new UserPanelViewModel()
            {
                User = GetUserSession(), IsUserLoggedIn = GetUserSession() != null
            };
            model.TopMenuItems      = _menuWebService.GetSubMenuItems();
            model.SuggestedProducts = _productWebService.GetSuggestedProducts(
                model.Login.User == null ?
                0 : model.Login.User.Id, HttpContext.Request.Host.ToString());

            return(View(model));
        }