Skip to content

Commit cffd071

Browse files
Prep for next release.
1 parent 576c980 commit cffd071

28 files changed

Lines changed: 1087 additions & 2188 deletions

Channel/AsChannel.cs

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
namespace Open.Database.Extensions;
1111

1212
[System.Diagnostics.CodeAnalysis.SuppressMessage("Reliability", "CA2012:Use ValueTasks correctly", Justification = "Intentionally running in the background.")]
13+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Roslynator", "RCS1047:Non-asynchronous method name should not end with 'Async'.", Justification = "<Pending>")]
1314
public static partial class ChannelDbExtensions
1415
{
1516
/// <summary>
16-
/// Iterates an IDataReader and writes each record as an array to an unbound channel.
17+
/// Iterates an <see cref="IDataReader"/> and writes each record as an array to an unbound channel.
1718
/// Be sure to await the completion.
1819
/// </summary>
1920
/// <param name="reader">The IDataReader to iterate.</param>
@@ -33,7 +34,7 @@ public static ChannelReader<object[]> AsChannel(this IDataReader reader,
3334
}
3435

3536
/// <summary>
36-
/// Iterates an IDataReader and writes each record as an array to an unbound channel.
37+
/// Iterates an <see cref="IDataReader"/> and writes each record as an array to an unbound channel.
3738
/// Be sure to await the completion.
3839
/// </summary>
3940
/// <param name="reader">The IDataReader to iterate.</param>
@@ -56,7 +57,7 @@ public static ChannelReader<object[]> AsChannel(this IDataReader reader,
5657
}
5758

5859
/// <summary>
59-
/// Iterates an IDataReader through the transform function and writes each record to an unbound channel.
60+
/// Iterates an <see cref="IDataReader"/> through the transform function and writes each record to an unbound channel.
6061
/// Be sure to await the completion.
6162
/// </summary>
6263
/// <typeparam name="T">The return type of the transform function.</typeparam>
@@ -80,7 +81,7 @@ public static ChannelReader<T> AsChannel<T>(this IDataReader reader,
8081
}
8182

8283
/// <summary>
83-
/// Iterates an IDataReader mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
84+
/// Iterates an <see cref="IDataReader"/> mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
8485
/// </summary>
8586
/// <typeparam name="T">The return type of the transform function.</typeparam>
8687
/// <param name="reader">The IDataReader to iterate.</param>
@@ -101,7 +102,7 @@ public static ChannelReader<T> AsChannel<T>(this IDataReader reader,
101102
}
102103

103104
/// <summary>
104-
/// Iterates an IDataReader mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
105+
/// Iterates an <see cref="IDataReader"/> mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
105106
/// </summary>
106107
/// <typeparam name="T">The return type of the transform function.</typeparam>
107108
/// <param name="reader">The IDataReader to iterate.</param>
@@ -124,7 +125,7 @@ public static ChannelReader<T> AsChannel<T>(this IDataReader reader,
124125
}
125126

126127
/// <summary>
127-
/// Iterates an IDataReader and writes each record as an array to an unbound channel.
128+
/// Iterates an <see cref="IDataReader"/> and writes each record as an array to an unbound channel.
128129
/// Be sure to await the completion.
129130
/// </summary>
130131
/// <param name="command">The command to acquire a reader from to iterate.</param>
@@ -144,7 +145,7 @@ public static ChannelReader<object[]> AsChannel(this IDbCommand command,
144145
}
145146

146147
/// <summary>
147-
/// Iterates an IDataReader and writes each record as an array to an unbound channel.
148+
/// Iterates an <see cref="IDataReader"/> and writes each record as an array to an unbound channel.
148149
/// Be sure to await the completion.
149150
/// </summary>
150151
/// <param name="command">The command to acquire a reader from to iterate.</param>
@@ -167,7 +168,7 @@ public static ChannelReader<object[]> AsChannel(this IDbCommand command,
167168
}
168169

169170
/// <summary>
170-
/// Iterates an IDataReader through the transform function and writes each record to an unbound channel.
171+
/// Iterates an <see cref="IDataReader"/> through the transform function and writes each record to an unbound channel.
171172
/// Be sure to await the completion.
172173
/// </summary>
173174
/// <typeparam name="T">The return type of the transform function.</typeparam>
@@ -191,7 +192,7 @@ public static ChannelReader<T> AsChannel<T>(this IDbCommand command,
191192
}
192193

193194
/// <summary>
194-
/// Iterates an IDataReader mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
195+
/// Iterates an <see cref="IDataReader"/> mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
195196
/// </summary>
196197
/// <typeparam name="T">The return type of the transform function.</typeparam>
197198
/// <param name="command">The command to acquire a reader from to iterate.</param>
@@ -212,7 +213,7 @@ public static ChannelReader<T> AsChannel<T>(this IDbCommand command,
212213
}
213214

214215
/// <summary>
215-
/// Iterates an IDataReader mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
216+
/// Iterates an <see cref="IDataReader"/> mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
216217
/// </summary>
217218
/// <typeparam name="T">The return type of the transform function.</typeparam>
218219
/// <param name="command">The command to acquire a reader from to iterate.</param>
@@ -235,7 +236,7 @@ public static ChannelReader<T> AsChannel<T>(this IDbCommand command,
235236
}
236237

237238
/// <summary>
238-
/// Iterates an IDataReader and writes each record as an array to an unbound channel.
239+
/// Iterates an <see cref="IDataReader"/> and writes each record as an array to an unbound channel.
239240
/// Be sure to await the completion.
240241
/// </summary>
241242
/// <param name="command">The IDataReader to iterate.</param>
@@ -253,7 +254,7 @@ public static ChannelReader<object[]> AsChannel(this IExecuteReader command,
253254
}
254255

255256
/// <summary>
256-
/// Iterates an IDataReader and writes each record as an array to an unbound channel.
257+
/// Iterates an <see cref="IDataReader"/> and writes each record as an array to an unbound channel.
257258
/// Be sure to await the completion.
258259
/// </summary>
259260
/// <param name="command">The IDataReader to iterate.</param>
@@ -274,7 +275,7 @@ public static ChannelReader<object[]> AsChannel(this IExecuteReader command,
274275
}
275276

276277
/// <summary>
277-
/// Iterates an IDataReader through the transform function and writes each record to an unbound channel.
278+
/// Iterates an <see cref="IDataReader"/> through the transform function and writes each record to an unbound channel.
278279
/// Be sure to await the completion.
279280
/// </summary>
280281
/// <typeparam name="T">The return type of the transform function.</typeparam>
@@ -296,7 +297,7 @@ public static ChannelReader<T> AsChannel<T>(this IExecuteReader command,
296297
}
297298

298299
/// <summary>
299-
/// Iterates an IDataReader mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
300+
/// Iterates an <see cref="IDataReader"/> mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
300301
/// </summary>
301302
/// <typeparam name="T">The return type of the transform function.</typeparam>
302303
/// <param name="command">The IDataReader to iterate.</param>
@@ -315,7 +316,7 @@ public static ChannelReader<T> AsChannel<T>(this IExecuteReader command,
315316
}
316317

317318
/// <summary>
318-
/// Iterates an IDataReader mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
319+
/// Iterates an <see cref="IDataReader"/> mapping the results to classes of type <typeparamref name="T"/> and writes each record an unbound channel.
319320
/// </summary>
320321
/// <typeparam name="T">The return type of the transform function.</typeparam>
321322
/// <param name="command">The IDataReader to iterate.</param>
@@ -336,16 +337,16 @@ public static ChannelReader<T> AsChannel<T>(this IExecuteReader command,
336337
}
337338

338339
#if NETSTANDARD2_1
339-
/// <summary>
340-
/// Asynchronously iterates an DbDataReader and writes each record as an array to an unbound channel.
341-
/// Iterates an DbDataReader through the transform function and writes each record to an unbound channel.
342-
/// Be sure to await the completion.
343-
/// </summary>
344-
/// <param name="reader">The IDataReader to iterate.</param>
345-
/// <param name="singleReader">True will cause the resultant reader to optimize for the assumption that no concurrent read operations will occur.</param>
346-
/// <param name="cancellationToken">An optional cancellation token.</param>
347-
/// <returns>The channel reader containing the results.</returns>
348-
public static ChannelReader<object[]> AsChannelAsync(this DbDataReader reader,
340+
/// <summary>
341+
/// Asynchronously iterates an DbDataReader and writes each record as an array to an unbound channel.
342+
/// Iterates an DbDataReader through the transform function and writes each record to an unbound channel.
343+
/// Be sure to await the completion.
344+
/// </summary>
345+
/// <param name="reader">The IDataReader to iterate.</param>
346+
/// <param name="singleReader">True will cause the resultant reader to optimize for the assumption that no concurrent read operations will occur.</param>
347+
/// <param name="cancellationToken">An optional cancellation token.</param>
348+
/// <returns>The channel reader containing the results.</returns>
349+
public static ChannelReader<object[]> AsChannelAsync(this DbDataReader reader,
349350
bool singleReader,
350351
CancellationToken cancellationToken = default)
351352
{

Channel/CreateChannel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics.Contracts;
23
using System.Threading.Channels;
34

45
namespace Open.Database.Extensions;
@@ -9,6 +10,7 @@ internal static Channel<T> CreateChannel<T>(int capacity = -1, bool singleReader
910
{
1011
if (capacity == 0) throw new ArgumentOutOfRangeException(nameof(capacity), capacity, "Cannot be zero.");
1112
if (capacity < -1) throw new ArgumentOutOfRangeException(nameof(capacity), capacity, "Must greater than zero or equal to negative one (unbounded).");
13+
Contract.EndContractBlock();
1214

1315
return capacity > 0
1416
? Channel.CreateBounded<T>(new BoundedChannelOptions(capacity)

0 commit comments

Comments
 (0)