1
1
namespace Open . Database . Extensions ;
2
2
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>" ) ]
5
5
public static partial class ChannelDbExtensions
6
6
{
7
7
/// <summary>
@@ -19,7 +19,7 @@ public static ChannelReader<object[]> AsChannel(this IDataReader reader,
19
19
if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
20
20
Contract . EndContractBlock ( ) ;
21
21
22
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
22
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
23
23
_ = ToChannel ( reader , channel . Writer , true , cancellationToken ) ;
24
24
return channel . Reader ;
25
25
}
@@ -42,7 +42,7 @@ public static ChannelReader<object[]> AsChannel(this IDataReader reader,
42
42
if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
43
43
Contract . EndContractBlock ( ) ;
44
44
45
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
45
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
46
46
_ = ToChannel ( reader , channel . Writer , true , arrayPool , cancellationToken ) ;
47
47
return channel . Reader ;
48
48
}
@@ -66,7 +66,7 @@ public static ChannelReader<T> AsChannel<T>(this IDataReader reader,
66
66
if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
67
67
Contract . EndContractBlock ( ) ;
68
68
69
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
69
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
70
70
_ = ToChannel ( reader , channel . Writer , true , transform , cancellationToken ) ;
71
71
return channel . Reader ;
72
72
}
@@ -87,7 +87,7 @@ public static ChannelReader<T> AsChannel<T>(this IDataReader reader,
87
87
if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
88
88
Contract . EndContractBlock ( ) ;
89
89
90
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
90
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
91
91
_ = ToChannel ( reader , channel . Writer , true , cancellationToken ) ;
92
92
return channel . Reader ;
93
93
}
@@ -110,7 +110,7 @@ public static ChannelReader<T> AsChannel<T>(this IDataReader reader,
110
110
if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
111
111
Contract . EndContractBlock ( ) ;
112
112
113
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
113
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
114
114
_ = ToChannel ( reader , channel . Writer , true , fieldMappingOverrides , cancellationToken ) ;
115
115
return channel . Reader ;
116
116
}
@@ -130,7 +130,7 @@ public static ChannelReader<object[]> AsChannel(this IDbCommand command,
130
130
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
131
131
Contract . EndContractBlock ( ) ;
132
132
133
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
133
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
134
134
_ = ToChannel ( command , channel . Writer , true , cancellationToken ) ;
135
135
return channel . Reader ;
136
136
}
@@ -153,7 +153,7 @@ public static ChannelReader<object[]> AsChannel(this IDbCommand command,
153
153
if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
154
154
Contract . EndContractBlock ( ) ;
155
155
156
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
156
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
157
157
_ = ToChannel ( command , channel . Writer , true , arrayPool , cancellationToken ) ;
158
158
return channel . Reader ;
159
159
}
@@ -177,7 +177,7 @@ public static ChannelReader<T> AsChannel<T>(this IDbCommand command,
177
177
if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
178
178
Contract . EndContractBlock ( ) ;
179
179
180
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
180
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
181
181
_ = ToChannel ( command , channel . Writer , true , transform , cancellationToken ) ;
182
182
return channel . Reader ;
183
183
}
@@ -198,7 +198,7 @@ public static ChannelReader<T> AsChannel<T>(this IDbCommand command,
198
198
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
199
199
Contract . EndContractBlock ( ) ;
200
200
201
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
201
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
202
202
_ = ToChannel ( command , channel . Writer , true , cancellationToken ) ;
203
203
return channel . Reader ;
204
204
}
@@ -221,7 +221,7 @@ public static ChannelReader<T> AsChannel<T>(this IDbCommand command,
221
221
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
222
222
Contract . EndContractBlock ( ) ;
223
223
224
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
224
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
225
225
_ = ToChannel ( command , channel . Writer , true , fieldMappingOverrides , cancellationToken ) ;
226
226
return channel . Reader ;
227
227
}
@@ -239,7 +239,7 @@ public static ChannelReader<object[]> AsChannel(this IExecuteReader command,
239
239
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
240
240
Contract . EndContractBlock ( ) ;
241
241
242
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
242
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
243
243
_ = ToChannel ( command , channel . Writer , true ) ;
244
244
return channel . Reader ;
245
245
}
@@ -260,7 +260,7 @@ public static ChannelReader<object[]> AsChannel(this IExecuteReader command,
260
260
if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
261
261
Contract . EndContractBlock ( ) ;
262
262
263
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
263
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
264
264
_ = ToChannel ( command , channel . Writer , true , arrayPool ) ;
265
265
return channel . Reader ;
266
266
}
@@ -282,7 +282,7 @@ public static ChannelReader<T> AsChannel<T>(this IExecuteReader command,
282
282
if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
283
283
Contract . EndContractBlock ( ) ;
284
284
285
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
285
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
286
286
_ = ToChannel ( command , channel . Writer , true , transform ) ;
287
287
return channel . Reader ;
288
288
}
@@ -301,7 +301,7 @@ public static ChannelReader<T> AsChannel<T>(this IExecuteReader command,
301
301
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
302
302
Contract . EndContractBlock ( ) ;
303
303
304
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
304
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
305
305
_ = ToChannel ( command , channel . Writer , true ) ;
306
306
return channel . Reader ;
307
307
}
@@ -322,7 +322,7 @@ public static ChannelReader<T> AsChannel<T>(this IExecuteReader command,
322
322
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
323
323
Contract . EndContractBlock ( ) ;
324
324
325
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
325
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
326
326
_ = ToChannel ( command , channel . Writer , true , fieldMappingOverrides ) ;
327
327
return channel . Reader ;
328
328
}
@@ -345,7 +345,7 @@ public static ChannelReader<object[]> AsChannelAsync(this DbDataReader reader,
345
345
if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
346
346
Contract . EndContractBlock ( ) ;
347
347
348
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
348
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
349
349
_ = ToChannelAsync ( reader , channel . Writer , true , cancellationToken ) ;
350
350
return channel . Reader ;
351
351
}
@@ -368,7 +368,7 @@ public static ChannelReader<object[]> AsChannelAsync(this DbDataReader reader,
368
368
if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
369
369
Contract . EndContractBlock ( ) ;
370
370
371
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
371
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
372
372
_ = ToChannelAsync ( reader , channel . Writer , true , arrayPool , cancellationToken ) ;
373
373
return channel . Reader ;
374
374
}
@@ -392,7 +392,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbDataReader reader,
392
392
if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
393
393
Contract . EndContractBlock ( ) ;
394
394
395
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
395
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
396
396
_ = ToChannelAsync ( reader , channel . Writer , true , transform , cancellationToken ) ;
397
397
return channel . Reader ;
398
398
}
@@ -413,7 +413,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbDataReader reader,
413
413
if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
414
414
Contract . EndContractBlock ( ) ;
415
415
416
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
416
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
417
417
_ = ToChannelAsync ( reader , channel . Writer , true , cancellationToken ) ;
418
418
return channel . Reader ;
419
419
}
@@ -436,7 +436,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbDataReader reader,
436
436
if ( reader is null ) throw new ArgumentNullException ( nameof ( reader ) ) ;
437
437
Contract . EndContractBlock ( ) ;
438
438
439
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
439
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
440
440
_ = ToChannelAsync ( reader , channel . Writer , true , fieldMappingOverrides , cancellationToken ) ;
441
441
return channel . Reader ;
442
442
}
@@ -456,7 +456,7 @@ public static ChannelReader<object[]> AsChannelAsync(this DbCommand command,
456
456
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
457
457
Contract . EndContractBlock ( ) ;
458
458
459
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
459
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
460
460
_ = ToChannelAsync ( command , channel . Writer , true , cancellationToken ) ;
461
461
return channel . Reader ;
462
462
}
@@ -479,7 +479,7 @@ public static ChannelReader<object[]> AsChannelAsync(this DbCommand command,
479
479
if ( arrayPool is null ) throw new ArgumentNullException ( nameof ( arrayPool ) ) ;
480
480
Contract . EndContractBlock ( ) ;
481
481
482
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
482
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
483
483
_ = ToChannelAsync ( command , channel . Writer , true , arrayPool , cancellationToken ) ;
484
484
return channel . Reader ;
485
485
}
@@ -503,7 +503,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbCommand command,
503
503
if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
504
504
Contract . EndContractBlock ( ) ;
505
505
506
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
506
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
507
507
_ = ToChannelAsync ( command , channel . Writer , true , transform , cancellationToken ) ;
508
508
return channel . Reader ;
509
509
}
@@ -524,7 +524,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbCommand command,
524
524
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
525
525
Contract . EndContractBlock ( ) ;
526
526
527
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
527
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
528
528
_ = ToChannelAsync ( command , channel . Writer , true , cancellationToken ) ;
529
529
return channel . Reader ;
530
530
}
@@ -547,7 +547,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this DbCommand command,
547
547
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
548
548
Contract . EndContractBlock ( ) ;
549
549
550
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
550
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
551
551
_ = ToChannelAsync ( command , channel . Writer , true , fieldMappingOverrides , cancellationToken ) ;
552
552
return channel . Reader ;
553
553
}
@@ -565,7 +565,7 @@ public static ChannelReader<object[]> AsChannelAsync(this IExecuteReaderAsync co
565
565
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
566
566
Contract . EndContractBlock ( ) ;
567
567
568
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
568
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
569
569
_ = ToChannelAsync ( command , channel . Writer , true ) ;
570
570
return channel . Reader ;
571
571
}
@@ -585,7 +585,7 @@ public static ChannelReader<object[]> AsChannelAsync(this IExecuteReaderAsync co
585
585
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
586
586
Contract . EndContractBlock ( ) ;
587
587
588
- var channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
588
+ Channel < object [ ] > channel = CreateChannel < object [ ] > ( - 1 , singleReader ) ;
589
589
_ = ToChannelAsync ( command , channel . Writer , true , arrayPool ) ;
590
590
return channel . Reader ;
591
591
}
@@ -607,7 +607,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this IExecuteReaderAsync comman
607
607
if ( transform is null ) throw new ArgumentNullException ( nameof ( transform ) ) ;
608
608
Contract . EndContractBlock ( ) ;
609
609
610
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
610
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
611
611
_ = ToChannelAsync ( command , channel . Writer , true , transform ) ;
612
612
return channel . Reader ;
613
613
}
@@ -626,7 +626,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this IExecuteReaderAsync comman
626
626
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
627
627
Contract . EndContractBlock ( ) ;
628
628
629
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
629
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
630
630
_ = ToChannelAsync ( command , channel . Writer , true ) ;
631
631
return channel . Reader ;
632
632
}
@@ -647,7 +647,7 @@ public static ChannelReader<T> AsChannelAsync<T>(this IExecuteReaderAsync comman
647
647
if ( command is null ) throw new ArgumentNullException ( nameof ( command ) ) ;
648
648
Contract . EndContractBlock ( ) ;
649
649
650
- var channel = CreateChannel < T > ( - 1 , singleReader ) ;
650
+ Channel < T > channel = CreateChannel < T > ( - 1 , singleReader ) ;
651
651
_ = ToChannelAsync ( command , channel . Writer , true , fieldMappingOverrides ) ;
652
652
return channel . Reader ;
653
653
}
0 commit comments