private IndexViewModel GetIndexViewModel() { var cafes = mCafeRepository.GetCompanyCafes(4); return(new IndexViewModel { CompanyContact = GetCompanyContactModel(), CompanyCafes = GetCompanyCafesModel(cafes) }); }
private IndexViewModel GetIndexViewModel() { var cafes = cafeRepository.GetCompanyCafes(ContentItemIdentifiers.CAFES, 4); return(new IndexViewModel { CompanyContact = GetCompanyContactModel(), CompanyCafes = GetCompanyCafesModel(cafes) }); }
public ActionResult Index() { var companyCafes = mCafeRepository.GetCompanyCafes(4); var partnerCafes = mCafeRepository.GetPartnerCafes(); var model = new Models.Cafes.IndexViewModel { CompanyCafes = GetCompanyCafesModel(companyCafes), PartnerCafes = GetPartnerCafesModel(partnerCafes) }; mOutputCacheDependencies.AddDependencyOnPages <Cafe>(); mOutputCacheDependencies.AddDependencyOnInfoObjects <CountryInfo>(); mOutputCacheDependencies.AddDependencyOnInfoObjects <StateInfo>(); return(View(model)); }
public ActionResult Index() { var section = dataContextRetriever.Retrieve <TreeNode>().Page; var companyCafes = cafeRespository.GetCompanyCafes(section.NodeAliasPath, 4); var partnerCafes = cafeRespository.GetPartnerCafes(section.NodeAliasPath); var model = new Models.Cafes.IndexViewModel { CompanyCafes = GetCompanyCafesModel(companyCafes), PartnerCafes = GetPartnerCafesModel(partnerCafes) }; outputCacheDependencies.AddDependencyOnPages(companyCafes); outputCacheDependencies.AddDependencyOnPages(partnerCafes); outputCacheDependencies.AddDependencyOnInfoObjects <CountryInfo>(); outputCacheDependencies.AddDependencyOnInfoObjects <StateInfo>(); return(View(model)); }
public ActionResult Index() { var viewModel = new IndexViewModel { LatestArticles = mArticleRepository.GetArticles(5).Select(ArticleViewModel.GetViewModel) }; var ourStory = mAboutUsRepository.GetOurStory(); if (ourStory != null) { viewModel.OurStory = ourStory.Fields.Teaser; } viewModel.CompanyCafes = mCafeRepository.GetCompanyCafes(4); mOutputCacheDependencies.AddDependencyOnPages <Article>(); mOutputCacheDependencies.AddDependencyOnPages <AboutUs>(); mOutputCacheDependencies.AddDependencyOnPages <Cafe>(); return(View(viewModel)); }
/// <summary> /// Returns an enumerable collection of company cafes ordered by a significance. /// </summary> /// <param name="count">The number of cafes to return. Use 0 as value to return all records.</param> /// <returns>An enumerable collection that contains the specified number of cafes ordered by a significance.</returns> public IEnumerable <Cafe> GetPromotedCompanyCafes(int count = 0) { return(mCafeRepository.GetCompanyCafes(count)); }