mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 02:14:53 +08:00
-
This commit is contained in:
@@ -349,10 +349,11 @@ namespace SqlSugar
|
||||
public List<T> ToList()
|
||||
{
|
||||
var sqlObj =this.ToSql();
|
||||
var isComplexModel = Regex.IsMatch(sqlObj.Key, @"AS \[\w+\.\w+\]");
|
||||
using (var dataReader = this.Db.GetDataReader(sqlObj.Key, sqlObj.Value.ToArray()))
|
||||
{
|
||||
var tType = typeof(T);
|
||||
if (tType.IsAnonymousType())
|
||||
if (tType.IsAnonymousType()||isComplexModel)
|
||||
{
|
||||
return this.Context.RewritableMethods.DataReaderToDynamicList<T>(dataReader);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user