public void Save(PartyMember obj) { if (obj.Id == 0) context.Entry(obj).State = System.Data.Entity.EntityState.Added; else context.Entry(obj).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); }
public ActionResult Edit(PartyMember obj) { if (ModelState.IsValid) { dataManager.PartyMembers.Save(obj); return RedirectToAction("Show", new { Id = obj.Id }); } return View(obj); }