|
@ -1278,16 +1278,16 @@ namespace SqlSugar |
|
|
tableName = this.QueryBuilder.JoinQueryInfos.First().TableName; |
|
|
tableName = this.QueryBuilder.JoinQueryInfos.First().TableName; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
var current = this.Context.Queryable<T>().AS(tableName).InSingle(primaryKeyValue); |
|
|
var current = this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).InSingle(primaryKeyValue); |
|
|
if (current != null) |
|
|
if (current != null) |
|
|
{ |
|
|
{ |
|
|
result.Add(current); |
|
|
result.Add(current); |
|
|
object parentId = ParentInfo.PropertyInfo.GetValue(current,null); |
|
|
object parentId = ParentInfo.PropertyInfo.GetValue(current,null); |
|
|
int i = 0; |
|
|
int i = 0; |
|
|
while (parentId!=null&&this.Context.Queryable<T>().AS(tableName).In(parentId).Any()) |
|
|
while (parentId!=null&&this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).In(parentId).Any()) |
|
|
{ |
|
|
{ |
|
|
Check.Exception(i > 100, ErrorMessage.GetThrowMessage("Dead cycle", "出现死循环或超出循环上限(100),检查最顶层的ParentId是否是null或者0")); |
|
|
Check.Exception(i > 100, ErrorMessage.GetThrowMessage("Dead cycle", "出现死循环或超出循环上限(100),检查最顶层的ParentId是否是null或者0")); |
|
|
var parent = this.Context.Queryable<T>().AS(tableName).InSingle(parentId); |
|
|
var parent = this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).InSingle(parentId); |
|
|
result.Add(parent); |
|
|
result.Add(parent); |
|
|
parentId= ParentInfo.PropertyInfo.GetValue(parent, null); |
|
|
parentId= ParentInfo.PropertyInfo.GetValue(parent, null); |
|
|
++i; |
|
|
++i; |
|
@ -1316,7 +1316,7 @@ namespace SqlSugar |
|
|
tableName = this.QueryBuilder.JoinQueryInfos.First().TableName; |
|
|
tableName = this.QueryBuilder.JoinQueryInfos.First().TableName; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
var current = this.Context.Queryable<T>().AS(tableName).Where(new List<IConditionalModel>() { |
|
|
var current = this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).Where(new List<IConditionalModel>() { |
|
|
new ConditionalModel() |
|
|
new ConditionalModel() |
|
|
{ |
|
|
{ |
|
|
ConditionalType = ConditionalType.Equal, |
|
|
ConditionalType = ConditionalType.Equal, |
|
@ -1329,7 +1329,7 @@ namespace SqlSugar |
|
|
result.Add(current); |
|
|
result.Add(current); |
|
|
object parentId = ParentInfo.PropertyInfo.GetValue(current, null); |
|
|
object parentId = ParentInfo.PropertyInfo.GetValue(current, null); |
|
|
int i = 0; |
|
|
int i = 0; |
|
|
while (parentId != null && this.Context.Queryable<T>().AS(tableName).Where(new List<IConditionalModel>() { |
|
|
while (parentId != null && this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).Where(new List<IConditionalModel>() { |
|
|
new ConditionalModel() |
|
|
new ConditionalModel() |
|
|
{ |
|
|
{ |
|
|
ConditionalType = ConditionalType.Equal, |
|
|
ConditionalType = ConditionalType.Equal, |
|
@ -1339,7 +1339,7 @@ namespace SqlSugar |
|
|
} }).Any()) |
|
|
} }).Any()) |
|
|
{ |
|
|
{ |
|
|
Check.Exception(i > 100, ErrorMessage.GetThrowMessage("Dead cycle", "出现死循环或超出循环上限(100),检查最顶层的ParentId是否是null或者0")); |
|
|
Check.Exception(i > 100, ErrorMessage.GetThrowMessage("Dead cycle", "出现死循环或超出循环上限(100),检查最顶层的ParentId是否是null或者0")); |
|
|
var parent = this.Context.Queryable<T>().AS(tableName).Where(new List<IConditionalModel>() { |
|
|
var parent = this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).Where(new List<IConditionalModel>() { |
|
|
new ConditionalModel() |
|
|
new ConditionalModel() |
|
|
{ |
|
|
{ |
|
|
ConditionalType = ConditionalType.Equal, |
|
|
ConditionalType = ConditionalType.Equal, |
|
@ -1380,16 +1380,16 @@ namespace SqlSugar |
|
|
tableName = this.QueryBuilder.JoinQueryInfos.First().TableName; |
|
|
tableName = this.QueryBuilder.JoinQueryInfos.First().TableName; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
var current =await this.Context.Queryable<T>().AS(tableName).InSingleAsync(primaryKeyValue); |
|
|
var current =await this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).InSingleAsync(primaryKeyValue); |
|
|
if (current != null) |
|
|
if (current != null) |
|
|
{ |
|
|
{ |
|
|
result.Add(current); |
|
|
result.Add(current); |
|
|
object parentId = ParentInfo.PropertyInfo.GetValue(current, null); |
|
|
object parentId = ParentInfo.PropertyInfo.GetValue(current, null); |
|
|
int i = 0; |
|
|
int i = 0; |
|
|
while (parentId != null &&await this.Context.Queryable<T>().AS(tableName).In(parentId).AnyAsync()) |
|
|
while (parentId != null &&await this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).In(parentId).AnyAsync()) |
|
|
{ |
|
|
{ |
|
|
Check.Exception(i > 100, ErrorMessage.GetThrowMessage("Dead cycle", "出现死循环或超出循环上限(100),检查最顶层的ParentId是否是null或者0")); |
|
|
Check.Exception(i > 100, ErrorMessage.GetThrowMessage("Dead cycle", "出现死循环或超出循环上限(100),检查最顶层的ParentId是否是null或者0")); |
|
|
var parent =await this.Context.Queryable<T>().AS(tableName).InSingleAsync(parentId); |
|
|
var parent =await this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).InSingleAsync(parentId); |
|
|
result.Add(parent); |
|
|
result.Add(parent); |
|
|
parentId = ParentInfo.PropertyInfo.GetValue(parent, null); |
|
|
parentId = ParentInfo.PropertyInfo.GetValue(parent, null); |
|
|
++i; |
|
|
++i; |
|
@ -1417,7 +1417,7 @@ namespace SqlSugar |
|
|
tableName = this.QueryBuilder.JoinQueryInfos.First().TableName; |
|
|
tableName = this.QueryBuilder.JoinQueryInfos.First().TableName; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
var current = await this.Context.Queryable<T>().AS(tableName).Where(new List<IConditionalModel>() { |
|
|
var current = await this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).Where(new List<IConditionalModel>() { |
|
|
new ConditionalModel() |
|
|
new ConditionalModel() |
|
|
{ |
|
|
{ |
|
|
ConditionalType = ConditionalType.Equal, |
|
|
ConditionalType = ConditionalType.Equal, |
|
@ -1430,7 +1430,7 @@ namespace SqlSugar |
|
|
result.Add(current); |
|
|
result.Add(current); |
|
|
object parentId = ParentInfo.PropertyInfo.GetValue(current, null); |
|
|
object parentId = ParentInfo.PropertyInfo.GetValue(current, null); |
|
|
int i = 0; |
|
|
int i = 0; |
|
|
while (parentId != null && await this.Context.Queryable<T>().AS(tableName).Where(new List<IConditionalModel>() { |
|
|
while (parentId != null && await this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).Where(new List<IConditionalModel>() { |
|
|
new ConditionalModel() |
|
|
new ConditionalModel() |
|
|
{ |
|
|
{ |
|
|
ConditionalType = ConditionalType.Equal, |
|
|
ConditionalType = ConditionalType.Equal, |
|
@ -1440,7 +1440,7 @@ namespace SqlSugar |
|
|
} }).AnyAsync()) |
|
|
} }).AnyAsync()) |
|
|
{ |
|
|
{ |
|
|
Check.Exception(i > 100, ErrorMessage.GetThrowMessage("Dead cycle", "出现死循环或超出循环上限(100),检查最顶层的ParentId是否是null或者0")); |
|
|
Check.Exception(i > 100, ErrorMessage.GetThrowMessage("Dead cycle", "出现死循环或超出循环上限(100),检查最顶层的ParentId是否是null或者0")); |
|
|
var parent = await this.Context.Queryable<T>().AS(tableName).Where(new List<IConditionalModel>() { |
|
|
var parent = await this.Context.Queryable<T>().AS(tableName).Filter(null, this.QueryBuilder.IsDisabledGobalFilter).Where(new List<IConditionalModel>() { |
|
|
new ConditionalModel() |
|
|
new ConditionalModel() |
|
|
{ |
|
|
{ |
|
|
ConditionalType = ConditionalType.Equal, |
|
|
ConditionalType = ConditionalType.Equal, |
|
|