Exemple #1
0
        public ScienceLandingPageViewModel GetViewModel(ScienceLandingPage model)
        {
            var homePage = model.Site <HomePage>();

            return(new ScienceLandingPageViewModel()
            {
                FeaturedQuote = model.FeaturedQuote,
                CalloutCards = _calloutCardsService.GetCalloutCards(model.CalloutCards),
                LatestNewsSection = _latestNewsSectionService.GetViewModel(homePage),
                LatestUpdates = GetLatestUpdates(model),
                ResourcesCollections = GetResourcesCollections(model)
            });
        }
        public HomePageViewModel GetViewModel(HomePage content)
        {
            var viewModel = new HomePageViewModel()
            {
                Carousel          = GetCarouselViewModel(content),
                CalloutCards      = _calloutCardsService.GetCalloutCards(content.CalloutCards),
                ResourcesTitle    = content.ResourcesTitle,
                ResourcesItems    = GetResourcesItems(content),
                LatestNewsSection = _latestNewsSectionService.GetViewModel(content)
            };

            return(viewModel);
        }