Пример #1
0
        public ActionResult Create(Blogger blogger)
        {
            if (ModelState.IsValid)
            {
                db.Blogers.Add(blogger);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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