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

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