public ScienceAtoZPageViewModel GetViewModel(ScienceAtoZpage model) { return(new ScienceAtoZPageViewModel() { Headline = model.GetHeadline(), Preamble = model.Preamble, CategorisedPages = GetCategorisedPages(model) }); }
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()); }
public SidebarViewModel GetSidebarViewModel(ScienceAtoZpage model) { return(CreateViewModel <SidebarViewModel>(model)); }
public ActionResult Index(ScienceAtoZpage model) { var viewModel = _scienceAtoZPageService.GetViewModel(model); return(CurrentTemplate(viewModel)); }