コード例 #1
0
        public ActionResult Edit(Driver driver)
        {
            if (ModelState.IsValid)
            {
                repository.Edit(driver);
                return RedirectToAction("Index");
            }

            return View(driver);
        }
コード例 #2
0
        public ActionResult Create_Post()
        {
            Driver driver = new Driver();
            TryUpdateModel<Driver>(driver);

            if (ModelState.IsValid)
            {
                repository.Add(driver);
                return RedirectToAction("Index");
            }
            return View();
        }