Example #1
0
        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));
        }