コード例 #1
0
 public ActionResult Add(Car c)
 {
     if (ModelState.IsValid)
     {
         repo.AddCar(c);
         return(RedirectToAction("All"));
     }
     else
     {
         ViewBag.brands = repo.GetCarBrands();
         ViewBag.types  = repo.GetCarTypes();
         return(View(c));
     }
 }