public IActionResult Post([FromBody] BookViewModel bookViewModel) { if (!ModelState.IsValid) { NotifyModelStateErrors(); return(Response(bookViewModel)); } _bookAppService.Register(bookViewModel); return(Response(bookViewModel)); }
public IActionResult Create(BookViewModel bookViewModel) { if (!ModelState.IsValid) { return(View(bookViewModel)); } _bookAppService.Register(bookViewModel); if (IsValidOperation()) { ViewBag.Sucesso = "Book Registered!"; } return(View(bookViewModel)); }