// GET: /<controller>/ public IActionResult Index(ListCarViewModel cars) { if (!ModelState.IsValid) return View(); DataManager.ListCars(cars); return View(cars); }
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; } } }