コード例 #1
0
 public ActionResult Create(CreateForm entity)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _service.Create(entity.ToClient());
             return(RedirectToAction("Index"));
         }
         else
         {
             return(View());
         }
     }
     catch
     {
         ViewBag.Error = "Le nom est déjà répertorié";
         return(View());
     }
 }