11namespace Open . Database . Extensions ;
22
3- [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Reliability" , "CA2012:Use ValueTasks correctly" , Justification = "Intentionally running in the background." ) ]
4- [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Roslynator" , "RCS1047:Non-asynchronous method name should not end with 'Async'." , Justification = "<Pending>" ) ]
3+ [ SuppressMessage ( "Reliability" , "CA2012:Use ValueTasks correctly" , Justification = "Intentionally running in the background." ) ]
4+ [ SuppressMessage ( "Roslynator" , "RCS1047:Non-asynchronous method name should not end with 'Async'." , Justification = "<Pending>" ) ]
55public static partial class ChannelDbExtensions
66{
77 /// <summary>
@@ -19,7 +19,7 @@ public static ChannelReader<object[]> AsChannel(this IDataReader reader,
1919 if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
2020 Contract . EndContractBlock ( ) ;
2121
22- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
22+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
2323 _ = ToChannel ( reader , channel . Writer , true , cancellationToken ) ;
2424 return channel . Reader ;
2525 }
@@ -42,7 +42,7 @@ public static ChannelReader<object[]> AsChannel(this IDataReader reader,
4242 if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
4343 Contract . EndContractBlock ( ) ;
4444
45- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
45+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
4646 _ = ToChannel ( reader , channel . Writer , true , arrayPool , cancellationToken ) ;
4747 return channel . Reader ;
4848 }
@@ -66,7 +66,7 @@ public static ChannelReader<T> AsChannel<T>(this IDataReader reader,
6666 if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
6767 Contract . EndContractBlock ( ) ;
6868
69- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
69+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
7070 _ = ToChannel ( reader , channel . Writer , true , transform , cancellationToken ) ;
7171 return channel . Reader ;
7272 }
@@ -87,7 +87,7 @@ public static ChannelReader<T> AsChannel<T>(this IDataReader reader,
8787 if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
8888 Contract . EndContractBlock ( ) ;
8989
90- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
90+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
9191 _ = ToChannel ( reader , channel . Writer , true , cancellationToken ) ;
9292 return channel . Reader ;
9393 }
@@ -110,7 +110,7 @@ public static ChannelReader<T> AsChannel<T>(this IDataReader reader,
110110 if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
111111 Contract . EndContractBlock ( ) ;
112112
113- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
113+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
114114 _ = ToChannel ( reader , channel . Writer , true , fieldMappingOverrides , cancellationToken ) ;
115115 return channel . Reader ;
116116 }
@@ -130,7 +130,7 @@ public static ChannelReader<object[]> AsChannel(this IDbCommand command,
130130 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
131131 Contract . EndContractBlock ( ) ;
132132
133- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
133+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
134134 _ = ToChannel ( command , channel . Writer , true , cancellationToken ) ;
135135 return channel . Reader ;
136136 }
@@ -153,7 +153,7 @@ public static ChannelReader<object[]> AsChannel(this IDbCommand command,
153153 if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
154154 Contract . EndContractBlock ( ) ;
155155
156- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
156+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
157157 _ = ToChannel ( command , channel . Writer , true , arrayPool , cancellationToken ) ;
158158 return channel . Reader ;
159159 }
@@ -177,7 +177,7 @@ public static ChannelReader<T> AsChannel<T>(this IDbCommand command,
177177 if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
178178 Contract . EndContractBlock ( ) ;
179179
180- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
180+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
181181 _ = ToChannel ( command , channel . Writer , true , transform , cancellationToken ) ;
182182 return channel . Reader ;
183183 }
@@ -198,7 +198,7 @@ public static ChannelReader<T> AsChannel<T>(this IDbCommand command,
198198 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
199199 Contract . EndContractBlock ( ) ;
200200
201- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
201+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
202202 _ = ToChannel ( command , channel . Writer , true , cancellationToken ) ;
203203 return channel . Reader ;
204204 }
@@ -221,7 +221,7 @@ public static ChannelReader<T> AsChannel<T>(this IDbCommand command,
221221 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
222222 Contract . EndContractBlock ( ) ;
223223
224- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
224+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
225225 _ = ToChannel ( command , channel . Writer , true , fieldMappingOverrides , cancellationToken ) ;
226226 return channel . Reader ;
227227 }
@@ -239,7 +239,7 @@ public static ChannelReader<object[]> AsChannel(this IExecuteReader command,
239239 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
240240 Contract . EndContractBlock ( ) ;
241241
242- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
242+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
243243 _ = ToChannel ( command , channel . Writer , true ) ;
244244 return channel . Reader ;
245245 }
@@ -260,7 +260,7 @@ public static ChannelReader<object[]> AsChannel(this IExecuteReader command,
260260 if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
261261 Contract . EndContractBlock ( ) ;
262262
263- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
263+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
264264 _ = ToChannel ( command , channel . Writer , true , arrayPool ) ;
265265 return channel . Reader ;
266266 }
@@ -282,7 +282,7 @@ public static ChannelReader<T> AsChannel<T>(this IExecuteReader command,
282282 if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
283283 Contract . EndContractBlock ( ) ;
284284
285- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
285+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
286286 _ = ToChannel ( command , channel . Writer , true , transform ) ;
287287 return channel . Reader ;
288288 }
@@ -301,7 +301,7 @@ public static ChannelReader<T> AsChannel<T>(this IExecuteReader command,
301301 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
302302 Contract . EndContractBlock ( ) ;
303303
304- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
304+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
305305 _ = ToChannel ( command , channel . Writer , true ) ;
306306 return channel . Reader ;
307307 }
@@ -322,7 +322,7 @@ public static ChannelReader<T> AsChannel<T>(this IExecuteReader command,
322322 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
323323 Contract . EndContractBlock ( ) ;
324324
325- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
325+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
326326 _ = ToChannel ( command , channel . Writer , true , fieldMappingOverrides ) ;
327327 return channel . Reader ;
328328 }
@@ -345,7 +345,7 @@ public static ChannelReader<object[]> AsChannelAsync(this DbDataReader reader,
345345 if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
346346 Contract . EndContractBlock ( ) ;
347347
348- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
348+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
349349 _ = ToChannelAsync ( reader , channel . Writer , true , cancellationToken ) ;
350350 return channel . Reader ;
351351 }
@@ -368,7 +368,7 @@ public static ChannelReader<object[]> AsChannelAsync(this DbDataReader reader,
368368 if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
369369 Contract . EndContractBlock ( ) ;
370370
371- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
371+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
372372 _ = ToChannelAsync ( reader , channel . Writer , true , arrayPool , cancellationToken ) ;
373373 return channel . Reader ;
374374 }
@@ -392,7 +392,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbDataReader reader,
392392 if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
393393 Contract . EndContractBlock ( ) ;
394394
395- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
395+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
396396 _ = ToChannelAsync ( reader , channel . Writer , true , transform , cancellationToken ) ;
397397 return channel . Reader ;
398398 }
@@ -413,7 +413,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbDataReader reader,
413413 if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
414414 Contract . EndContractBlock ( ) ;
415415
416- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
416+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
417417 _ = ToChannelAsync ( reader , channel . Writer , true , cancellationToken ) ;
418418 return channel . Reader ;
419419 }
@@ -436,7 +436,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbDataReader reader,
436436 if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
437437 Contract . EndContractBlock ( ) ;
438438
439- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
439+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
440440 _ = ToChannelAsync ( reader , channel . Writer , true , fieldMappingOverrides , cancellationToken ) ;
441441 return channel . Reader ;
442442 }
@@ -456,7 +456,7 @@ public static ChannelReader<object[]> AsChannelAsync(this DbCommand command,
456456 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
457457 Contract . EndContractBlock ( ) ;
458458
459- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
459+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
460460 _ = ToChannelAsync ( command , channel . Writer , true , cancellationToken ) ;
461461 return channel . Reader ;
462462 }
@@ -479,7 +479,7 @@ public static ChannelReader<object[]> AsChannelAsync(this DbCommand command,
479479 if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
480480 Contract . EndContractBlock ( ) ;
481481
482- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
482+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
483483 _ = ToChannelAsync ( command , channel . Writer , true , arrayPool , cancellationToken ) ;
484484 return channel . Reader ;
485485 }
@@ -503,7 +503,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbCommand command,
503503 if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
504504 Contract . EndContractBlock ( ) ;
505505
506- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
506+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
507507 _ = ToChannelAsync ( command , channel . Writer , true , transform , cancellationToken ) ;
508508 return channel . Reader ;
509509 }
@@ -524,7 +524,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbCommand command,
524524 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
525525 Contract . EndContractBlock ( ) ;
526526
527- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
527+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
528528 _ = ToChannelAsync ( command , channel . Writer , true , cancellationToken ) ;
529529 return channel . Reader ;
530530 }
@@ -547,7 +547,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbCommand command,
547547 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
548548 Contract . EndContractBlock ( ) ;
549549
550- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
550+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
551551 _ = ToChannelAsync ( command , channel . Writer , true , fieldMappingOverrides , cancellationToken ) ;
552552 return channel . Reader ;
553553 }
@@ -565,7 +565,7 @@ public static ChannelReader<object[]> AsChannelAsync(this IExecuteReaderAsync co
565565 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
566566 Contract . EndContractBlock ( ) ;
567567
568- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
568+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
569569 _ = ToChannelAsync ( command , channel . Writer , true ) ;
570570 return channel . Reader ;
571571 }
@@ -585,7 +585,7 @@ public static ChannelReader<object[]> AsChannelAsync(this IExecuteReaderAsync co
585585 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
586586 Contract . EndContractBlock ( ) ;
587587
588- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
588+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
589589 _ = ToChannelAsync ( command , channel . Writer , true , arrayPool ) ;
590590 return channel . Reader ;
591591 }
@@ -607,7 +607,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this IExecuteReaderAsync comman
607607 if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
608608 Contract . EndContractBlock ( ) ;
609609
610- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
610+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
611611 _ = ToChannelAsync ( command , channel . Writer , true , transform ) ;
612612 return channel . Reader ;
613613 }
@@ -626,7 +626,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this IExecuteReaderAsync comman
626626 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
627627 Contract . EndContractBlock ( ) ;
628628
629- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
629+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
630630 _ = ToChannelAsync ( command , channel . Writer , true ) ;
631631 return channel . Reader ;
632632 }
@@ -647,7 +647,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this IExecuteReaderAsync comman
647647 if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
648648 Contract . EndContractBlock ( ) ;
649649
650- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
650+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
651651 _ = ToChannelAsync ( command , channel . Writer , true , fieldMappingOverrides ) ;
652652 return channel . Reader ;
653653 }
0 commit comments