@ -777,45 +777,39 @@ namespace SqlSugar
result = GetData < T > ( typeof ( T ) , dataReader ) ;
}
List < T2 > result2 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T2 > ( ) ;
NextResult ( dataReader ) ;
result2 = GetData < T2 > ( typeof ( T2 ) , dataReader ) ;
}
List < T3 > result3 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T3 > ( ) ;
NextResult ( dataReader ) ;
result3 = GetData < T3 > ( typeof ( T3 ) , dataReader ) ;
}
List < T4 > result4 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T4 > ( ) ;
NextResult ( dataReader ) ;
result4 = GetData < T4 > ( typeof ( T4 ) , dataReader ) ;
}
List < T5 > result5 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T5 > ( ) ;
NextResult ( dataReader ) ;
result5 = GetData < T5 > ( typeof ( T5 ) , dataReader ) ;
}
List < T6 > result6 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T6 > ( ) ;
NextResult ( dataReader ) ;
result6 = GetData < T6 > ( typeof ( T6 ) , dataReader ) ;
}
List < T7 > result7 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T7 > ( ) ;
NextResult ( dataReader ) ;
result7 = GetData < T7 > ( typeof ( T7 ) , dataReader ) ;
}
builder . SqlQueryBuilder . Clear ( ) ;
@ -834,7 +828,6 @@ namespace SqlSugar
return Tuple . Create < List < T > , List < T2 > , List < T3 > , List < T4 > , List < T5 > , List < T6 > , List < T7 > > ( result , result2 , result3 , result4 , result5 , result6 , result7 ) ;
}
}
public virtual Task < List < T > > SqlQueryAsync < T > ( string sql , object parameters = null )
{
var sugarParameters = this . GetParameters ( parameters ) ;
@ -898,45 +891,39 @@ namespace SqlSugar
result = await GetDataAsync < T > ( typeof ( T ) , dataReader ) ;
}
List < T2 > result2 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T2 > ( ) ;
NextResult ( dataReader ) ;
result2 = await GetDataAsync < T2 > ( typeof ( T2 ) , dataReader ) ;
}
List < T3 > result3 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T3 > ( ) ;
NextResult ( dataReader ) ;
result3 = await GetDataAsync < T3 > ( typeof ( T3 ) , dataReader ) ;
}
List < T4 > result4 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T4 > ( ) ;
NextResult ( dataReader ) ;
result4 = await GetDataAsync < T4 > ( typeof ( T4 ) , dataReader ) ;
}
List < T5 > result5 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T5 > ( ) ;
NextResult ( dataReader ) ;
result5 = await GetDataAsync < T5 > ( typeof ( T5 ) , dataReader ) ;
}
List < T6 > result6 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T6 > ( ) ;
NextResult ( dataReader ) ;
result6 = await GetDataAsync < T6 > ( typeof ( T6 ) , dataReader ) ;
}
List < T7 > result7 = null ;
if ( DbReader . HasRows )
if ( NextResult ( dataReader ) )
{
this . Context . InitMappingInfo < T7 > ( ) ;
NextResult ( dataReader ) ;
result7 = await GetDataAsync < T7 > ( typeof ( T7 ) , dataReader ) ;
}
builder . SqlQueryBuilder . Clear ( ) ;
@ -1165,17 +1152,29 @@ namespace SqlSugar
#endregion
#region Helper
private static void NextResult ( IDataReader dataReader )
//private static void NextResult(IDataReader dataReader)
//{
// try
// {
// NextResult(dataReader);
// }
// catch
// {
// // Check.Exception(true, ErrorMessage.GetThrowMessage("Please reduce the number of T. Save Queue Changes queries don't have so many results", "请减少T的数量,SaveQueueChanges 查询没有这么多结果"));
// }
//}
private static bool NextResult ( IDataReader dataReader )
{
try
{
dataReader . NextResult ( ) ;
return dataReader . NextResult ( ) ;
}
catch
catch
{
// Check.Exception(true, ErrorMessage.GetThrowMessage("Please reduce the number of T. Save Queue Changes queries don't have so many results", "请减少T的数量,SaveQueueChanges 查询没有这么多结果"));
return false ;
}
}
private void ExecuteProcessingSQL ( ref string sql , SugarParameter [ ] parameters )
{
var result = this . ProcessingEventStartingSQL ( sql , parameters ) ;