Exemplo n.º 1
0
        // GET: Autores/Delete/5
        public ActionResult Delete(int id)
        {
            var livro      = _livroApp.GetById(id);
            var livroModel = new LivroTransformation().TransformarLivroEmLivroModel(livro);

            return(View(livroModel));
        }
Exemplo n.º 2
0
        public ActionResult Edit(LivroModel livroModel)
        {
            if (ModelState.IsValid)
            {
                var livro = new LivroTransformation().TransformarLivroModelEmLivro(livroModel);
                _livroApp.Update(livro);

                return(RedirectToAction("Index"));
            }

            return(View(livroModel));
        }
Exemplo n.º 3
0
        // GET: Autores
        public ActionResult Index()
        {
            IEnumerable <LivroModel> livroModel = new LivroTransformation().TransformarLivroEmLivroModel(_livroApp.GetAll());

            return(View(livroModel));
        }