コード例 #1
0
 public ActionResult Create(ModeloViewModel modeloVM)
 {
     if (ModelState.IsValid)
     {
         Modelo modelo = Mapper.Map <ModeloViewModel, Modelo>(modeloVM);
         service.Adicionar(modelo);
         return(RedirectToAction("Index"));
     }
     //deu ruim
     modeloVM.ListaFabricantes = new SelectList(service.ListarFabricantes(), "FabricanteID", null);
     return(View(modeloVM));
 }