// GET: Livros/Create public ActionResult Create() { ViewBag.AutorId = new SelectList(_autorApp.GetAll(), "AutorId", "Nome"); ViewBag.CategoriaId = new SelectList(_categoriaApp.GetAll(), "CategoriaId", "Nome"); ViewBag.EditoraId = new SelectList(_editoraApp.GetAll(), "EditoraId", "Nome"); return(View()); }
// GET: Editoras public ActionResult Index() { var editoraViewModel = Mapper.Map <IEnumerable <Editora>, IEnumerable <EditoraViewModel> >(_editoraApp.GetAll()); return(View(editoraViewModel)); }