Beispiel #1
0
 // GET: /<controller>/
 public IActionResult Index(ListCarViewModel cars)
 {
     if (!ModelState.IsValid)
         return View();
     DataManager.ListCars(cars);
     return View(cars);
 }
Beispiel #2
0
 public static void ListCars(ListCarViewModel model)
 {
     foreach (var car in cars)
     {
         model.Brand = car.Brand;
         if (car.TopSpeed > 250)
         {
             model.ShowAsFast = true;
         }
         else if (car.TopSpeed <= 250)
         {
             model.ShowAsFast = false;
         }
     }
 }