mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-26 13:43:10 +08:00
Bug: Subquery.ToList
This commit is contained in:
@@ -1051,9 +1051,7 @@ namespace SqlSugar
|
||||
var parameters = (expression as LambdaExpression).Parameters;
|
||||
var columnsResult = this.Context.EntityMaintenance.GetEntityInfo<TResult>().Columns;
|
||||
sql = AppendSelect(this.EntityInfo.Columns,sql, parameters, columnsResult, 0);
|
||||
var result= this.Select<TResult>(sql);
|
||||
result.QueryBuilder.SelectValue = expression;
|
||||
return result;
|
||||
return this.Select<TResult>(sql);
|
||||
}
|
||||
|
||||
public virtual ISugarQueryable<TResult> Select<TResult>()
|
||||
|
||||
@@ -688,9 +688,10 @@ namespace SqlSugar
|
||||
}
|
||||
protected string SubToListMethod(string result)
|
||||
{
|
||||
string oldResult = result;
|
||||
List<string> names = new List<string>();
|
||||
var allShortName = new List<string>();
|
||||
if (IsSingleSubToList())
|
||||
if (IsSingleSubToList())
|
||||
{
|
||||
this.TableShortName = (SelectValue as LambdaExpression).Parameters[0].Name;
|
||||
}
|
||||
@@ -699,7 +700,7 @@ namespace SqlSugar
|
||||
{
|
||||
foreach (var item in this.JoinQueryInfos)
|
||||
{
|
||||
allShortName.Add(this.Builder.SqlTranslationLeft + Builder.GetNoTranslationColumnName(item.ShortName.ObjToString().ToLower() ) + this.Builder.SqlTranslationRight + ".");
|
||||
allShortName.Add(this.Builder.SqlTranslationLeft + Builder.GetNoTranslationColumnName(item.ShortName.ObjToString().ToLower()) + this.Builder.SqlTranslationRight + ".");
|
||||
}
|
||||
}
|
||||
else if (this.EasyJoinInfos != null && this.EasyJoinInfos.Any())
|
||||
@@ -736,9 +737,13 @@ namespace SqlSugar
|
||||
this.AppendColumns = colums;
|
||||
}
|
||||
}
|
||||
|
||||
if (HasAppText(oldResult))
|
||||
{
|
||||
return oldResult;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Get SQL Partial
|
||||
@@ -1029,5 +1034,9 @@ namespace SqlSugar
|
||||
&& this.SelectValue is Expression
|
||||
&& this.IsSingle();
|
||||
}
|
||||
private static bool HasAppText(string result)
|
||||
{
|
||||
return result.HasValue() && result.Contains("app_ext_col_0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user