Esempio n. 1
0
        public ActionResult Index()
        {
            @ViewBag.Category = MainCategory.Home;
            List<HomepageAlbumModel> models = new List<HomepageAlbumModel>();
            AlbumRepository repo = new AlbumRepository();

            models.Add(new HomepageAlbumModel()
            {
                Name = "Popular",
                Albums = Helpers.Convert(repo.GetMostPopular(ALBUMS_IN_CATEGORY))
            });

            models.Add(new HomepageAlbumModel()
            {
                Name = "Top rated",
                Albums = Helpers.Convert(repo.GetTopRated(ALBUMS_IN_CATEGORY))
            });

            models.Add(new HomepageAlbumModel()
            {
                Name = "Random",
                Albums = Helpers.Convert(repo.GetRandom(ALBUMS_IN_CATEGORY))
            });

            models.Add(new HomepageAlbumModel()
            {
                Name = "Biggest",
                Albums = Helpers.Convert(repo.GetBiggest(ALBUMS_IN_CATEGORY))
            });

            models.Add(new HomepageAlbumModel()
            {
                Name = "Recently commented",
                Albums = Helpers.Convert(repo.GetRecentlyCommented(ALBUMS_IN_CATEGORY))
            });

            models.Add(new HomepageAlbumModel()
            {
                Name = "Most commented",
                Albums = Helpers.Convert(repo.GetMostCommented(ALBUMS_IN_CATEGORY))
            });

            return View(models);
        }