public ActionResult Create(AddVehicule addVehicule) { try { if (ModelState.IsValid) { var vehiculo = new Vehiculo() { ID = addVehicule.ID, IDMecanico = addVehicule.SelectedMecanico, IDModelo = addVehicule.SelectedModelo, IDProveedor = addVehicule.SelectedProveedor, Precio = addVehicule.Precio }; var vehiculoInsertar = Mapper.Map <DATOS.Vehiculo>(vehiculo); veh.InsertarVehiculo(vehiculoInsertar); return(RedirectToAction("Index")); } else { return(View()); } } catch { return(View()); } }