/// <summary> /// 更新方法 /// </summary> /// <param name="mqJournal">参数</param> public static void Update(this HaiXinMqJournal mqJournal) { try { mqJournal.EntityState = EntityState.Modified; ContextFactory.CurrentThreadContext.SaveChanges(); } catch (Exception ex) { LogHelper.Error("BE.HaiXinMqJournal.Create异常", ex); } }
/// <summary> /// /// </summary> /// <param name="dto"></param> public void Create(HaiXinMqJournalDTO dto) { try { var entity = HaiXinMqJournal.FromDTO(dto); entity.EntityState = EntityState.Added; ContextFactory.CurrentThreadContext.SaveObject(entity); ContextFactory.CurrentThreadContext.SaveChanges(); } catch (Exception ex) { LogHelper.Error("BE.HaiXinMqJournal.Create异常", ex); } }