mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-23 12:33:44 +08:00
Update Select(exp,true)
This commit is contained in:
@@ -960,17 +960,15 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public ISugarQueryable<TResult> Select<TResult>(Expression<Func<T, TResult>> expression, bool isAutoFill)
|
public ISugarQueryable<TResult> Select<TResult>(Expression<Func<T, TResult>> expression, bool isAutoFill)
|
||||||
{
|
{
|
||||||
var ps = this.Clone().Select(expression).QueryBuilder;
|
var clone = this.Clone();
|
||||||
|
//clone.QueryBuilder.LambdaExpressions.Index = QueryBuilder.LambdaExpressions.Index+1;
|
||||||
|
var ps = clone.Select(expression).QueryBuilder;
|
||||||
var sql = ps.GetSelectValue;
|
var sql = ps.GetSelectValue;
|
||||||
if (string.IsNullOrEmpty(sql) || sql.Trim() == "*")
|
if (string.IsNullOrEmpty(sql) || sql.Trim() == "*")
|
||||||
{
|
{
|
||||||
return this.Select<TResult>(expression);
|
return this.Select<TResult>(expression);
|
||||||
}
|
}
|
||||||
if (ps.Parameters != null && ps.Parameters.Any())
|
this.QueryBuilder.Parameters = ps.Parameters;
|
||||||
{
|
|
||||||
this.QueryBuilder.Parameters.AddRange(ps.Parameters);
|
|
||||||
this.QueryBuilder.LambdaExpressions.ParameterIndex += ps.Parameters.Count;
|
|
||||||
}
|
|
||||||
var parameters = (expression as LambdaExpression).Parameters;
|
var parameters = (expression as LambdaExpression).Parameters;
|
||||||
var columnsResult = this.Context.EntityMaintenance.GetEntityInfo<TResult>().Columns;
|
var columnsResult = this.Context.EntityMaintenance.GetEntityInfo<TResult>().Columns;
|
||||||
sql = AppendSelect(this.EntityInfo.Columns,sql, parameters, columnsResult, 0);
|
sql = AppendSelect(this.EntityInfo.Columns,sql, parameters, columnsResult, 0);
|
||||||
|
Reference in New Issue
Block a user