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