public ActionResult Create(Link link) { try { // TODO: Add insert logic here LinkService.Add(link.Title, link.Url); return RedirectToAction("List"); } catch { return View(); } }
public ActionResult AddLink(Link link) { DBNLDataContext db = new DBNLDataContext(); db.Links.InsertOnSubmit(link); db.SubmitChanges(); return RedirectToAction("ListLinks"); }
public ActionResult EditLink(int id, Link link) { DBNLDataContext db = new DBNLDataContext(); Link updLink = db.Links.Where(p => p.Id == id).SingleOrDefault(); updLink.CreatedDate = link.CreatedDate; updLink.Title = link.Title; updLink.UpdatedDate = link.UpdatedDate; updLink.Url = link.Url; db.SubmitChanges(); return RedirectToAction("ListLinks"); }
partial void DeleteLink(Link instance);
partial void UpdateLink(Link instance);
partial void InsertLink(Link instance);