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

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