Пример #1
0
 public ActionResult Create(ProductCRVM newProduct)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _partsBL.AddProduct(_mapper.cast2Product(newProduct));
             return(RedirectToAction(nameof(Index)));
         }
         catch
         {
             Log.Warning("Unable to create Product");
             return(RedirectToAction(nameof(Index)));
         }
     }
     else
     {
         return(RedirectToAction(nameof(Index)));
     }
 }