Exemplo n.º 1
0
        public IActionResult DeleteConfirmed(BookAuthorVm model)
        {
            var bookAuthor = _unitOfWork.BookAuthors.GetById(model.Id);

            _unitOfWork.BookAuthors.Delete(bookAuthor);
            _unitOfWork.Complate();
            return(RedirectToAction("Index", "Home"));
        }
Exemplo n.º 2
0
 public IActionResult CreateWithBook(BookAuthorVm model)
 {
     if (ModelState.IsValid)
     {
         BookAuthor bookAuthor = _mapper.Map <BookAuthor>(model);
         _unitOfWork.BookAuthors.Add(bookAuthor);
         _unitOfWork.Complate();
         return(RedirectToAction("Details", "Book", new { id = model.BookId }));
     }
     return(View(model));
 }