Exemplo n.º 1
0
        public ActionResult Show()
        {
            var article = articleRepository.GetCurrent();

            outputCacheDependencies.AddDependencyOnPage(article);

            return(new TemplateResult(article));
        }
        public ActionResult Index()
        {
            var selectedPage = GetProperties().SelectedCafes?.FirstOrDefault();
            var cafe         = (selectedPage != null) ? mCafeRepository.GetCafeByGuid(selectedPage.NodeGuid) : null;

            mOutputCacheDependencies.AddDependencyOnPage <Cafe>(cafe?.DocumentID ?? 0);

            return(PartialView("Widgets/_CafeCardWidget", CafeCardViewModel.GetViewModel(cafe)));
        }
        public ActionResult Index()
        {
            var selectedPage = componentPropertiesRetriever.Retrieve <CafeCardProperties>().SelectedCafes.FirstOrDefault();
            var cafe         = (selectedPage != null) ? repository.GetCafeByGuid(selectedPage.NodeGuid) : null;

            outputCacheDependencies.AddDependencyOnPage(cafe);

            return(PartialView("Widgets/_CafeCardWidget", CafeCardViewModel.GetViewModel(cafe, attachmentUrlRetriever)));
        }
        // [OutputCache(CacheProfile = "PageBuilder")]
        public async Task <ActionResult> Index(CancellationToken cancellationToken)
        {
            var home         = pageDataContextRetriever.Retrieve <Home>().Page;
            var homeSections = await homeSectionRepository.GetHomeSectionsAsync(home.NodeAliasPath, cancellationToken);

            var reference = (await referenceRepository.GetReferencesAsync(home.NodeAliasPath, cancellationToken, 1)).FirstOrDefault();

            var viewModel = new IndexViewModel
            {
                HomeSections = homeSections.Select(section => HomeSectionViewModel.GetViewModel(section, pageUrlRetriever, attachmentUrlRetriever)),
                Reference    = ReferenceViewModel.GetViewModel(reference, attachmentUrlRetriever)
            };

            outputCacheDependencies.AddDependencyOnPage(home);
            outputCacheDependencies.AddDependencyOnPages(homeSections);
            outputCacheDependencies.AddDependencyOnPage(reference);

            return(View(viewModel));
        }
        public ActionResult Index()
        {
            var selectedPage = componentPropertiesRetriever.Retrieve <ProductCardProperties>().SelectedProducts.FirstOrDefault();

            var product = (selectedPage != null) ? repository.GetProduct(selectedPage.NodeGuid) : null;

            outputCacheDependencies.AddDependencyOnPage(product);

            return(PartialView("Widgets/_ProductCardWidget", ProductCardViewModel.GetViewModel(product)));
        }
        public ActionResult Index()
        {
            var selectedPage = GetProperties().SelectedProducts?.FirstOrDefault();

            var product = (selectedPage != null) ? mProductRepository.GetProduct(selectedPage.NodeGuid) : null;

            mOutputCacheDependencies.AddDependencyOnPage <SKUTreeNode>(product?.DocumentID ?? 0);

            return(PartialView("Widgets/_ProductCardWidget", ProductCardViewModel.GetViewModel(product)));
        }
        // GET: LandingPage
        // [OutputCache(CacheProfile = "PageBuilder")]
        public ActionResult Index(string pageAlias)
        {
            var landingPage = mRepository.GetLandingPage(pageAlias);

            if (landingPage == null)
            {
                return(HttpNotFound());
            }

            mOutputCacheDependencies.AddDependencyOnPage <LandingPage>(landingPage.DocumentID);

            return(new TemplateResult(landingPage.DocumentID));
        }
Exemplo n.º 8
0
        public async Task <ActionResult> Index(CancellationToken cancellationToken)
        {
            var aboutUs = dataRetriever.Retrieve <AboutUs>().Page;

            var sideStories = await aboutUsRepository.GetSideStoriesAsync(aboutUs.NodeAliasPath, cancellationToken);

            outputCacheDependencies.AddDependencyOnPages(sideStories);

            var reference = (await referenceRepository.GetReferencesAsync($"{aboutUs.NodeAliasPath}/References", cancellationToken, 1)).FirstOrDefault();

            outputCacheDependencies.AddDependencyOnPage(reference);

            AboutUsViewModel mode = new AboutUsViewModel()
            {
                Sections  = sideStories.Select(story => AboutUsSectionViewModel.GetViewModel(story, attachmentUrlRetriever)),
                Reference = ReferenceViewModel.GetViewModel(reference, attachmentUrlRetriever)
            };

            return(View(mode));
        }
Exemplo n.º 9
0
        // GET: Home
        // [OutputCache(CacheProfile = "PageBuilder")]
        public ActionResult Index()
        {
            var home = mHomeRepository.GetHomePage();

            if (home == null)
            {
                return(HttpNotFound());
            }

            HttpContext.Kentico().PageBuilder().Initialize(home.DocumentID);

            var viewModel = new IndexViewModel
            {
                HomeSections = mHomeRepository.GetHomeSections().Select(HomeSectionViewModel.GetViewModel)
            };

            mOutputCacheDependencies.AddDependencyOnPage <Home>(home.DocumentID);
            mOutputCacheDependencies.AddDependencyOnPages <HomeSection>();

            return(View(viewModel));
        }