Пример #1
0
 public static void AddCar(CreateCarViewModel model)
 {
     var car = new Car();
     car.Brand = model.Brand;
     car.Doors = model.Doors;
     car.TopSpeed = model.TopSpeed;
     cars.Add(car);
 }
Пример #2
0
 public IActionResult Create(CreateCarViewModel car)
 {
     if (!ModelState.IsValid)
         return View();
     else if (car.AcceptTerms == false)
         return View();
     DataManager.AddCar(car);
     return RedirectToAction("index");
 }