예제 #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;
 }