示例#1
0
 /// <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);
     }
 }
示例#2
0
 /// <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);
     }
 }