Пример #1
0
 public ActionResult Edit(TheNew thenew)
 {
     if (ModelState.IsValid)
     {
         db.Entry(thenew).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(thenew);
 }
Пример #2
0
        public ActionResult Create(TheNew thenew)
        {
            if (ModelState.IsValid)
            {
                db.TheNew.Add(thenew);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(thenew);
        }