public ActionResult Edit(Distributor distributor) { if (ModelState.IsValid) { _upriseContext.Entry(distributor).State = EntityState.Modified; _upriseContext.SaveChanges(); return(RedirectToAction("Index")); } return(new JsonResult(new { success = true, Response = Serializer.DeserializeDistributor(distributor) })); }
public void Update(Campaign campaign) { try { _upriseContext.Entry(campaign).State = EntityState.Modified; _upriseContext.SaveChanges(); } catch (Exception ex) { var message = ""; ErrorHelper.GetExceptionMessages(ex, message); throw new Exception(message); } }