コード例 #1
0
 public ScienceAtoZPageViewModel GetViewModel(ScienceAtoZpage model)
 {
     return(new ScienceAtoZPageViewModel()
     {
         Headline = model.GetHeadline(),
         Preamble = model.Preamble,
         CategorisedPages = GetCategorisedPages(model)
     });
 }
コード例 #2
0
        private IReadOnlyDictionary <char, IEnumerable <NavigationItemViewModel> > GetCategorisedPages(ScienceAtoZpage model)
        {
            var scienceLandingPage = model.Parent <ScienceLandingPage>();

            if (scienceLandingPage == null)
            {
                return(null);
            }

            var categorisablePages = scienceLandingPage.Children <IScienceCategorisablePage>();

            if (ExistenceUtility.IsNullOrEmpty(categorisablePages))
            {
                return(null);
            }

            return(categorisablePages.CategorisePages());
        }
コード例 #3
0
 public SidebarViewModel GetSidebarViewModel(ScienceAtoZpage model)
 {
     return(CreateViewModel <SidebarViewModel>(model));
 }
コード例 #4
0
        public ActionResult Index(ScienceAtoZpage model)
        {
            var viewModel = _scienceAtoZPageService.GetViewModel(model);

            return(CurrentTemplate(viewModel));
        }