Example #1
0
        public ActionResult Create(Xbox xbox)
        {
            if (ModelState.IsValid)
            {
                db.Xboxes.Add(xbox);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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