コード例 #1
0
ファイル: CarsController.cs プロジェクト: MrXtry/LabViews
 // GET: /<controller>/
 public IActionResult Index(ListCarViewModel cars)
 {
     if (!ModelState.IsValid)
         return View();
     DataManager.ListCars(cars);
     return View(cars);
 }
コード例 #2
0
ファイル: DataManager.cs プロジェクト: MrXtry/LabViews
 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;
         }
     }
 }