Exemplo n.º 1
0
        // GET: LivroController/Create
        public ActionResult Create()
        {
            IEnumerable <Autor>   listaAutores  = _autorService.ObterTodosOrdenadoPorNome();
            IEnumerable <Editora> listaEditoras = _editoraService.ObterTodos();

            ViewBag.IdEditora = new SelectList(listaEditoras, "IdEditora", "Nome", null);
            ViewBag.IdAutor   = new SelectList(listaAutores, "IdAutor", "Nome", null);
            return(View());
        }
        // GET: EditoraController
        public ActionResult Index()
        {
            var listaEditoraes      = _editoraService.ObterTodos();
            var listaEditoraesModel = _mapper.Map <List <EditoraModel> >(listaEditoraes);

            return(View(listaEditoraesModel));
        }
Exemplo n.º 3
0
 public IQueryable <Editora> ObterTodos()
 {
     return(_editoraService.ObterTodos());
 }