Esempio n. 1
0
        public IActionResult Index()
        {
            var title   = _localizer["Title"];
            var culture = HttpContext.Features.Get <IRequestCultureFeature>().RequestCulture.Culture.Name;

            ViewData["BodyClass"] = "cms-index-index cms-home-page";
            var homeVm = new HomeViewModel();

            homeVm.HomeBlogCategories = _blogCategoryService.GetHomeCategories(5);
            //homeVm.HotProducts = _productService.GetHotProduct(5);
            //homeVm.TopSellProducts = _productService.GetLastest(6);
            homeVm.LastestBlogs = _blogService.GetLastest(6);
            homeVm.HomeSlides   = _commonService.GetSlides(SlideGroup.Home.ToString());

            var webStructure = BuildWebsiteStructured();

            ViewData["WebsiteJson"] = JsonConvert.SerializeObject(BuildWebsiteStructured(), new JsonSerializerSettings {
                NullValueHandling = NullValueHandling.Ignore
            });
            return(View(homeVm));
        }