コード例 #1
0
 public ActionResult Create(AutorViewModel autorViewModel)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _autorApp.Create(autorViewModel);
             return(RedirectToAction(nameof(Index)));
         }
     }
     catch
     {
         return(View(autorViewModel));
     }
     return(View(autorViewModel));
 }
コード例 #2
0
 public void Post([FromBody] AutorViewModel autorViewModel)
 {
     _autorApp.Create(autorViewModel);
 }