コード例 #1
0
ファイル: HomeController.cs プロジェクト: KilicYavuz/Offer
        public ActionResult Index()
        {
            var objects = base.ViewBag.Data as Dictionary <string, dynamic> ?? new Dictionary <string, dynamic>();

            objects.Add("SearchCategories", Categories ?? new List <Category>());
            var mainScreenProducts  = ApiUtil.GetMainScreenProducts().Result;
            var bestSellerProducts  = ApiUtil.GetBestSellerProducts().Result;
            var opportunityProducts = ApiUtil.GetOpportunityProducts().Result;
            var newProducts         = ApiUtil.GetNewProducts().Result;
            var outletProducts      = ApiUtil.GetOutletProducts().Result;
            var brands     = ApiUtil.GetBrandList().Result;
            var categories = ApiUtil.GetCategoryList().Result;

            objects.Add("BestSellerProducts", bestSellerProducts);
            objects.Add("MainScreenProducts", mainScreenProducts);
            objects.Add("OpportunityProducts", opportunityProducts);
            objects.Add("NewProducts", newProducts);
            objects.Add("OutletProducts", outletProducts);
            objects.Add("Categories", categories);
            objects.Add("BrandList", brands);
            ViewBag.Data = objects;
            return(View());
        }