public ActionResult Create(Link link) { if (ModelState.IsValid) { db.Links.Add(link); db.SaveChanges(); return RedirectToAction("Index"); } return View(link); }
public ActionResult Edit(Link link) { if (ModelState.IsValid) { db.Entry(link).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(link); }