Exemple #1
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Song song = service.FindSongById(id);

            if (song == null)
            {
                return(HttpNotFound());
            }

            var viewModel = Mapper.Instance.Map <Song, DetailedSongViewModel>(song);

            ViewBag.Playlists = service.GetUserPlaylistsNotContaining(song);

            return(View(viewModel));
        }