コード例 #1
0
        // GET: Musica/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Musica musica = repositorioMusicas.SelecionarPorID(id.Value);

            if (musica == null)
            {
                return(HttpNotFound());
            }
            return(View(Mapper.Map <Musica, MusicaExibicaoViewModel>(musica)));
        }
コード例 #2
0
        // GET: Albuns/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            //Album album = db.Albums.Find(id);
            Album album = repositorioAlbuns.SelecionarPorID(id.Value);

            if (album == null)
            {
                return(HttpNotFound());
            }
            return(View(Mapper.Map <Album, AlbumExibicaoViewModel>(album)));
        }
コード例 #3
0
        // GET: Album/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Album album = repositorioAlbuns.SelecionarPorID(id.Value);

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

            //Mapa para realizar a converção do Domínio-Álbum para ViewModel-Álbum Exibição
            return(View(Mapper.Map <Album, AlbumExibicaoViewModel>(album)));
        }