public ActionResult Create(AutorViewModel autorViewModel) { try { if (ModelState.IsValid) { _autorApp.Create(autorViewModel); return(RedirectToAction(nameof(Index))); } } catch { return(View(autorViewModel)); } return(View(autorViewModel)); }
public void Post([FromBody] AutorViewModel autorViewModel) { _autorApp.Create(autorViewModel); }