Exemplo n.º 1
0
        public ActionResult Index()
        {
            var companyCafes = mCafeRepository.GetCompanyCafes(4);
            var partnerCafes = mCafeRepository.GetPartnerCafes();

            var model = new Models.Cafes.IndexViewModel
            {
                CompanyCafes = GetCompanyCafesModel(companyCafes),
                PartnerCafes = GetPartnerCafesModel(partnerCafes)
            };

            mOutputCacheDependencies.AddDependencyOnPages <Cafe>();
            mOutputCacheDependencies.AddDependencyOnInfoObjects <CountryInfo>();
            mOutputCacheDependencies.AddDependencyOnInfoObjects <StateInfo>();

            return(View(model));
        }
        public ActionResult Index()
        {
            var section      = dataContextRetriever.Retrieve <TreeNode>().Page;
            var companyCafes = cafeRespository.GetCompanyCafes(section.NodeAliasPath, 4);
            var partnerCafes = cafeRespository.GetPartnerCafes(section.NodeAliasPath);

            var model = new Models.Cafes.IndexViewModel
            {
                CompanyCafes = GetCompanyCafesModel(companyCafes),
                PartnerCafes = GetPartnerCafesModel(partnerCafes)
            };

            outputCacheDependencies.AddDependencyOnPages(companyCafes);
            outputCacheDependencies.AddDependencyOnPages(partnerCafes);
            outputCacheDependencies.AddDependencyOnInfoObjects <CountryInfo>();
            outputCacheDependencies.AddDependencyOnInfoObjects <StateInfo>();

            return(View(model));
        }