示例#1
0
        // GET: Book/Details/5
        public ActionResult Details(int id)
        {
            var bookDomain = _bookApp.GetById(id);
            var bookVM     = Mapper.Map <Book, BookViewModel>(bookDomain);

            return(View(bookVM));
        }
示例#2
0
        public IActionResult Details(Guid?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var customerViewModel = _bookAppService.GetById(id.Value);

            if (customerViewModel == null)
            {
                return(NotFound());
            }

            return(View(customerViewModel));
        }
示例#3
0
        public IActionResult Details(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var bookViewModelResult = _bookAppService.GetById(id.Value);

            if (bookViewModelResult?.Data == null)
            {
                return(NotFound());
            }

            return(View(bookViewModelResult.Data));
        }
示例#4
0
        public ActionResult Delete(BookViewModel book)
        {
            var bookToRemove = _bookApp.GetById(book.BookId);

            _bookApp.Remove(bookToRemove);

            return(Json("Success", JsonRequestBehavior.DenyGet));
        }
示例#5
0
 public BookViewModel Get(int id)
 {
     return(_bookService.GetById(id));
 }
示例#6
0
        public IActionResult Get(Guid id)
        {
            var livro = _bookAppService.GetById(id);

            return(Ok(_mapper.Map <ListBookViewModel>(livro)));
        }
示例#7
0
        public IActionResult Get(Guid id)
        {
            var customerViewModel = _bookAppService.GetById(id);

            return(Response(customerViewModel));
        }