예제 #1
0
        public ActionResult Create(answers answers)
        {
            if (ModelState.IsValid)
            {
                db.answers.Add(answers);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(answers);
        }
예제 #2
0
 public ActionResult Edit(answers answers)
 {
     if (ModelState.IsValid)
     {
         db.Entry(answers).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(answers);
 }