Пример #1
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));
        }