public ActionResult Create([Bind(Include = "Name,Abrv")] MakeViewModel make) { try { if (ModelState.IsValid) { vehicleMakeService.CreateVehicleMake(AutoMapper.Mapper.Map <VehicleMake>(make)); return(RedirectToAction("VehicleMakeList")); } } catch (DataException) { ModelState.AddModelError("", "Something went wrong! Can't create VehicleMake."); } return(RedirectToAction("Create")); }
public void CreateVehicleMake(int id, string name, string abrv) { vehicleMakeService.CreateVehicleMake(id, name, abrv); }