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

            return View(fan);
        }