Exemplo n.º 1
0
        public ActionResult UpdateIndexSongs(int genreId)
        {
            var viewModel = new ListSongsViewModel()
            {
                Songs = this.service.GetSongsByGenreId(genreId)
            };

            return(PartialView("_ListSongsPartial", viewModel));
        }
Exemplo n.º 2
0
        public ActionResult SearchFor(SearchSongBindingModel model)
        {
            var results = new HashSet <Song>();

            if (model.MatchWithSongName)
            {
                results.UnionWith(this.service.GetSongsNameContaining(model.SearchFor));
            }
            if (model.MatchWithUploaderName)
            {
                results.UnionWith(this.service.GetSongsUploaderNameContaining(model.SearchFor));
            }
            if (model.MatchWithUploaderUserName)
            {
                results.UnionWith(this.service.GetSongsUploaderUserNameContaining(model.SearchFor));
            }

            var viewModel = new ListSongsViewModel()
            {
                Songs = results
            };

            return(this.PartialView("_ListSongsPartial", viewModel));
        }