Ejemplo n.º 1
0
        public HomeIndexViewModel GetHomePageViewModel()
        {
            var totalEpisodes    = _episodeRepository.EpisodeCount();
            var totalPodcasts    = _podcastRepository.GetTotalPodcasts();
            var recentEpisodes   = _episodeRepository.GetMostRecentEpisodes(10);
            var featuredPodcasts = _podcastRepository.GetFeaturedPodcasts(5);

            return(new HomeIndexViewModel
            {
                TotalEpisodes = totalEpisodes,
                TotalPodcasts = totalPodcasts,
                FeaturedPodcasts = featuredPodcasts,
                RecentEpisodes = recentEpisodes
            });
        }