public ActionResult EditMemberStateHistory(FormCollection form, MemberStateHistoryCreateEditViewModel model) { if (ModelState.IsValid) { try { var memberStateHist = new MemberStateHistory(); Mapper.DynamicMap(model, memberStateHist); memberProvider.UpdateMemberStateHistory(memberStateHist); return(Json(new AjaxViewModel(true, model, null))); } catch (Exception ex) { return(Json(new AjaxViewModel(false, null, ex.Message))); } } return(View(model)); }
public void UpdateMemberStateHistory(MemberStateHistory memberStateHist) { context.Entry(memberStateHist).State = System.Data.Entity.EntityState.Modified; SetAuditFields(memberStateHist); context.SaveChanges(); }