Beispiel #1
0
 public ActionResult Edit(User user)
 {
     if (ModelState.IsValid)
     {
         context.Users.Update(user);
         return RedirectToAction("Index");
     }
     return View(user);
 }
Beispiel #2
0
        public ActionResult Create(User user)
        {
            if (ModelState.IsValid)
            {
                context.Users.Insert(user);
                return RedirectToAction("Index");
            }

            return View(user);
        }