コード例 #1
0
 public ActionResult Edit(Quiz quiz)
 {
     if (ModelState.IsValid)
     {
         db.Entry(quiz).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     PopulateStateDropdownList(quiz.StateID);
     return(View(quiz));
 }
コード例 #2
0
 public ActionResult Edit(
     [Bind(Exclude = "Date")]
     Exercise exercise)
 {
     if (ModelState.IsValid)
     {
         db.Entry(exercise).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     PopulateCategoryDropdownList(exercise.CategoryID);
     return(View(exercise));
 }