mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Optimized code select dto
This commit is contained in:
parent
6456c0c698
commit
c74b6c2381
@ -169,6 +169,7 @@ namespace OrmTest
|
||||
.Select(it=>new ViewOrder(){
|
||||
Name=SqlFunc.Subqueryable<Order>().Select(s=>s.Name)
|
||||
}).ToList();
|
||||
var test19 = db.Queryable<Order>().Select<ViewOrder>().ToList();
|
||||
Console.WriteLine("#### Examples End ####");
|
||||
}
|
||||
|
||||
|
@ -790,10 +790,14 @@ namespace SqlSugar
|
||||
var selectValue = new SugarMapper(this.Context).GetSelectValue<TResult>(this.QueryBuilder);
|
||||
return this.Select<TResult>(selectValue);
|
||||
}
|
||||
else if (this.QueryBuilder.EntityType == UtilConstants.ObjType || (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Count == 1)||this.QueryBuilder.EntityName!=this.QueryBuilder.EntityType.Name)
|
||||
{
|
||||
return this.Select<TResult>(this.SqlBuilder.SqlSelectAll);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
return this.Select<TResult>(this.SqlBuilder.SqlSelectAll);
|
||||
var selects = this.QueryBuilder.GetSelectValueByString();
|
||||
return this.Select<TResult>(selects);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user