public ActionResult Create(Link link) { try { profile.Links.Add(link); return RedirectToAction("Edit", "Profile"); } catch { return View(); } }
public ActionResult Edit(Link newLink) { if (ModelState.IsValid) { Link link = profile.Links.First(l => l.ID == newLink.ID); link.Name = newLink.Name; link.Url = newLink.Url; return RedirectToAction("Edit", "Profile"); } return View(newLink); }