Ejemplo n.º 1
0
        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 HomeIndexViewModel
            {
                HomeSections = homeSections.Select(section => HomeSectionViewModel.GetViewModel(section, pageUrlRetriever, attachmentUrlRetriever)),
                Reference    = ReferenceViewModel.GetViewModel(reference, attachmentUrlRetriever)
            };

            return(View(viewModel));
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Index(CancellationToken cancellationToken)
        {
            var aboutUs = dataRetriever.Retrieve <AboutUs>().Page;

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

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

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

            return(View(mode));
        }