Ejemplo n.º 1
0
 public ActionResult Editar(int id, CarVM model)
 {
     try
     {
         var car = Map(model);
         _carService.Update(car);
         return RedirectToAction("Index");
     }
     catch
     {
         return View(model);
     }
 }
Ejemplo n.º 2
0
 public Car Map(CarVM model)
 {
     return Mapper.Map<CarVM, Car>(model);
 }
Ejemplo n.º 3
0
 public ActionResult Deletar(int id, CarVM model)
 {
     try
     {
         var car = Map(model);
         _carService.Delete(car);
         return RedirectToAction("Index");
     }
     catch (ArgumentOutOfRangeException)
     {
         //modal
         return RedirectToAction("Index");
     }
     catch
     {
         return View(model);
     }
 }