コード例 #1
0
 /// <summary>
 /// 创建CloseAutoDetectChangeContext的实例
 /// </summary>
 /// <param name="wrap">AutoDetectChangeContextWrap实例</param>
 /// <returns></returns>
 public static CloseAutoDetectChangeContext InstanceCloseAutoDetectChangeContext(this AutoDetectChangeContextWrap wrap)
 {
     return(new CloseAutoDetectChangeContext(wrap));
 }
コード例 #2
0
 /// <summary>
 /// 创建CloseAutoDetectChangeContext的实例
 /// </summary>
 /// <param name="wrap">AutoDetectChangeContextWrap实例</param>
 /// <returns></wrap>
 public static void ForceDetectChange(this AutoDetectChangeContextWrap wrap, object entity)
 {
     wrap.ServiceData.BaseData.BaseDB.BaseDataContext.Entry(entity).State = EntityState.Modified;
 }
コード例 #3
0
 public CloseAutoDetectChangeContext(AutoDetectChangeContextWrap wrap)
 {
     _wrap = wrap;
     _wrap.ServiceData.BaseData.BaseDB.BaseDataContext.ChangeTracker.AutoDetectChangesEnabled = true;
 }