@@ -1268,37 +1268,45 @@ public static IEnumerable<T> DequeueEach<T>(this Queue<T> source)
1268
1268
}
1269
1269
1270
1270
/// <summary>
1271
- /// Reads the first column from every record and returns the results as a list. .
1272
- /// DBNull values are converted to null.
1271
+ /// Reads the first column values from every record.
1272
+ /// DBNull values are then converted to null.
1273
1273
/// </summary>
1274
- /// <returns>The list of values.</returns>
1274
+ /// <returns>The enumerable first ordinal values.</returns>
1275
1275
public static IEnumerable < object > FirstOrdinalResults ( this IDataReader reader )
1276
1276
{
1277
1277
var results = new Queue < object > ( reader . Iterate ( r => r . GetValue ( 0 ) ) ) ;
1278
1278
return results . DequeueEach ( ) . DBNullToNull ( ) ;
1279
1279
}
1280
1280
1281
1281
/// <summary>
1282
- /// Reads the first column from every record. .
1283
- /// DBNull values are converted to null.
1282
+ /// Reads the first column values from every record.
1283
+ /// Any DBNull values are then converted to null and casted to type T0;
1284
1284
/// </summary>
1285
1285
/// <returns>The enumerable of casted values.</returns>
1286
+ public static IEnumerable < T0 > FirstOrdinalResults < T0 > ( this IDataReader reader )
1287
+ => reader . FirstOrdinalResults ( ) . Cast < T0 > ( ) ;
1288
+
1289
+ /// <summary>
1290
+ /// Reads the first column values from every record.
1291
+ /// DBNull values are then converted to null.
1292
+ /// </summary>
1293
+ /// <returns>The enumerable first ordinal values.</returns>
1286
1294
public static IEnumerable < object > FirstOrdinalResults ( this IDbCommand command )
1287
1295
{
1288
1296
var results = new Queue < object > ( IterateReaderInternal ( command , CommandBehavior . Default , r => r . GetValue ( 0 ) ) ) ;
1289
1297
return results . DequeueEach ( ) . DBNullToNull ( ) ;
1290
1298
}
1291
1299
1292
1300
/// <summary>
1293
- /// Reads the first column from every record. .
1294
- /// DBNull values are converted to null.
1301
+ /// Reads the first column values from every record.
1302
+ /// Any DBNull values are then converted to null and casted to type T0;
1295
1303
/// </summary>
1296
1304
/// <returns>The enumerable of casted values.</returns>
1297
1305
public static IEnumerable < T0 > FirstOrdinalResults < T0 > ( this IDbCommand command )
1298
1306
=> command . FirstOrdinalResults ( ) . Cast < T0 > ( ) ;
1299
1307
1300
1308
/// <summary>
1301
- /// Reads the first column from every record and returns the results. .
1309
+ /// Reads the first column values from every record.
1302
1310
/// DBNull values are converted to null.
1303
1311
/// </summary>
1304
1312
/// <returns>The list of values.</returns>
@@ -1310,15 +1318,20 @@ public static async Task<IEnumerable<object>> FirstOrdinalResultsAsync(this DbDa
1310
1318
}
1311
1319
1312
1320
/// <summary>
1313
- /// Reads the first column from every record. .
1314
- /// DBNull values are converted to null.
1321
+ /// Reads the first column values from every record.
1322
+ /// Any DBNull values are then converted to null and casted to type T0;
1315
1323
/// </summary>
1316
1324
/// <returns>The enumerable of casted values.</returns>
1317
- public static IEnumerable < T0 > FirstOrdinalResults < T0 > ( this DbDataReader reader )
1318
- => reader . FirstOrdinalResults ( ) . Cast < T0 > ( ) ;
1325
+ public static async Task < IEnumerable < T0 > > FirstOrdinalResultsAsync < T0 > ( this DbDataReader reader )
1326
+ {
1327
+ var results = new Queue < object > ( ) ;
1328
+ await reader . ForEachAsync ( r => results . Enqueue ( r . GetValue ( 0 ) ) ) ;
1329
+ return results . DequeueEach ( ) . DBNullToNull ( ) . Cast < T0 > ( ) ; ;
1330
+ }
1331
+
1319
1332
1320
1333
/// <summary>
1321
- /// Reads the first column from every record and returns the results. .
1334
+ /// Reads the first column values from every record.
1322
1335
/// DBNull values are converted to null.
1323
1336
/// </summary>
1324
1337
/// <returns>The list of values.</returns>
@@ -1331,7 +1344,7 @@ public static async Task<IEnumerable<object>> FirstOrdinalResultsAsync(this DbCo
1331
1344
1332
1345
/// <summary>
1333
1346
/// Reads the first column from every record..
1334
- /// DBNull values are converted to null.
1347
+ /// Any DBNull values are then converted to null and casted to type T0;
1335
1348
/// </summary>
1336
1349
/// <returns>The enumerable of casted values.</returns>
1337
1350
public static async Task < IEnumerable < T0 > > FirstOrdinalResultsAsync < T0 > ( this DbCommand command )
0 commit comments