Пример #1
0
 public ActionResult Edit(UserClub userclub)
 {
     if (ModelState.IsValid)
     {
         db.Entry(userclub).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(userclub);
 }
Пример #2
0
        public ActionResult Create(UserClub userclub)
        {
            if (ModelState.IsValid)
            {
                userclub.UserName = User.Identity.Name;
                db.UserClubs.Add(userclub);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(userclub);
        }