// 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))); }
// 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))); }
// 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))); }