public AddVehicleModel(ObservableCollection <VehicleModel> vehicleModels, int id, VehicleMake vm)
 {
     InitializeComponent();
     lVehicleModels    = vehicleModels;
     addVehicleModelVM = new AddVehicleModelViewModel(lVehicleModels);
     this.id           = id;
     this.vehicleMake  = vm;
 }
Exemple #2
0
        public ActionResult Models(AddVehicleModelViewModel viewModel)
        {
            var model = new VehicleModel {
                Description = viewModel.VehicleModelDescription, MakeId = viewModel.MakeId
            };

            modelRepo.Create(model);

            return(RedirectToAction("Models"));
        }