Synchronization code

This commit is contained in:
sunkaixuan 2024-05-13 21:13:48 +08:00
parent e3ccc98d9f
commit 18dc271d58

View File

@ -1677,9 +1677,16 @@ namespace SqlSugar
result = this.Context.Utilities.DataReaderToExpandoObjectListNoUsing(dataReader).Select(it => ((TResult)(object)it)).ToList(); result = this.Context.Utilities.DataReaderToExpandoObjectListNoUsing(dataReader).Select(it => ((TResult)(object)it)).ToList();
} }
else if (entityType.IsAnonymousType()||StaticConfig.EnableAot) else if (entityType.IsAnonymousType()||StaticConfig.EnableAot)
{
if (StaticConfig.EnableAot&& entityType==UtilConstants.StringType)
{
result = this.Context.Ado.DbBind.DataReaderToListNoUsing<TResult>(entityType, dataReader);
}
else
{ {
result = this.Context.Utilities.DataReaderToListNoUsing<TResult>(dataReader); result = this.Context.Utilities.DataReaderToListNoUsing<TResult>(dataReader);
} }
}
else else
{ {
result = this.Context.Ado.DbBind.DataReaderToListNoUsing<TResult>(entityType, dataReader); result = this.Context.Ado.DbBind.DataReaderToListNoUsing<TResult>(entityType, dataReader);
@ -1699,9 +1706,16 @@ namespace SqlSugar
result = list.Select(it => ((TResult)(object)it)).ToList(); result = list.Select(it => ((TResult)(object)it)).ToList();
} }
else if (entityType.IsAnonymousType() || StaticConfig.EnableAot) else if (entityType.IsAnonymousType() || StaticConfig.EnableAot)
{
if (StaticConfig.EnableAot && entityType == UtilConstants.StringType)
{
result = await this.Context.Ado.DbBind.DataReaderToListNoUsingAsync<TResult>(entityType, dataReader);
}
else
{ {
result =await this.Context.Utilities.DataReaderToListAsyncNoUsing<TResult>(dataReader); result =await this.Context.Utilities.DataReaderToListAsyncNoUsing<TResult>(dataReader);
} }
}
else else
{ {
result =await this.Context.Ado.DbBind.DataReaderToListNoUsingAsync<TResult>(entityType, dataReader); result =await this.Context.Ado.DbBind.DataReaderToListNoUsingAsync<TResult>(entityType, dataReader);