You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b6045ae
Browse filesBrowse the repository at this point in the historyBrowse files
Cut the hover text of the shipped packages to what a member does and its traps, link the articles for the rest, and fix the statements that were false (#322)
The XML docs ship in the packages, so a hover that is wrong or that carries a whole article is worse than a short one. This is docs only; no code changes.
False statements fixed:
- The async ExecuteReader overloads no longer say behavior defaults to CommandBehavior.Default (they have no default), in Core and in the SQL Server package.
- ToPooledBufferStream no longer says the connection is freed before the consumer sees a row; it is released when the read ends.
- The buffered terminals no longer say the rows are buffered before the call returns.
- ToChannel and ToTargetBlock no longer say the channel or block is left as it was for complete: true, and name the returned ValueTask<long>.
- stallTimeout on the holding-connection overloads names StreamBuffered with a buffer of one row, not Stream.
- The ten synchronous terminals on the reader and table views now have summaries, so their hover is no longer empty.
Shortened to a summary, the traps and an article link: the Map, CancelOnEarlyStop, SingleResult, UsePool, pooled-memory, PooledBuffer, RowMap, NullPolicy, MappedDbQuery, ConnectionScope, reader-helper, transaction, output-parameter and name-matching remarks. The Stream, StreamBuffered and ToPooledStream comparison table is removed from the hovers; it stays in the Terminals article. Dead shared doc nodes are removed.
Docsite: a Connection scopes section in the foundation article, the held-connection explanation under reader and command helpers, the per-call switch rule for a mapped definition, and the Terminals link and ValueTask<long> wording in the channels article.
The factory and pool docs say the factory or pool must return a connection (null is not supported). SetTimeout says when the procedure-name lookup is bounded by it.
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: Source/Channel/ToChannel.Streaming.cs
+12-8Lines changed: 12 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,18 @@ public static partial class ChannelDbExtensions
10
10
/// </summary>
11
11
/// <remarks>
12
12
/// Holds the reader and the connection open for each row: while the channel is full,
13
-
/// the next row is not pulled and the connection stays open until
13
+
/// the read waits and the connection stays open until
14
14
/// <paramref name="stallTimeout"/> expires (never, with <see cref="Timeout.InfiniteTimeSpan"/>).
15
15
/// Use <see cref="ToChannel{T}(IMappedQuery{T}, Channel{T}, CancellationToken)"/>,
16
16
/// which frees the connection first, unless the rows must be pulled one at a time;
17
-
/// otherwise it behaves as that member.
18
-
/// See <see cref="IMappedQuery{T}.StreamBuffered(TimeSpan, int, CancellationToken)"/> (with a buffer of one row) for the stall rules.
17
+
/// otherwise it behaves the same, apart from the stall timeout.
18
+
/// See <see href="https://open-net-libraries.github.io/Open.Database.Extensions/articles/mapping.html#terminals">Terminals</see> for the stall rules.
19
19
/// </remarks>
20
20
/// <typeparam name="T">The type of each row.</typeparam>
21
21
/// <param name="source">The mapped query to read.</param>
22
22
/// <param name="channel">The channel to write to.</param>
23
23
/// <param name="stallTimeout">
24
-
/// The longest the channel may make no room while the reader is held. Required; passed to <c>Stream</c>.
24
+
/// The longest the channel may make no room while the reader is held. Required; passed to <see cref="IMappedQuery{T}.StreamBuffered(TimeSpan, int, CancellationToken)"/> with a buffer of one row.
25
25
/// The wait for room before the command runs is not timed.
@@ -53,7 +57,7 @@ public static ValueTask<long> ToChannelHoldingConnection<T>(
53
57
/// </param>
54
58
/// <param name="source">The mapped query to read.</param>
55
59
/// <param name="channel">The channel to write to.</param>
56
-
/// <param name="stallTimeout">The longest the channel may make no room while the reader is held. Required; passed to <c>Stream</c>.
60
+
/// <param name="stallTimeout">The longest the channel may make no room while the reader is held. Required; passed to <see cref="IMappedQuery{T}.StreamBuffered(TimeSpan, int, CancellationToken)"/> with a buffer of one row.
57
61
/// The wait for room before the command runs is not timed.</param>
/// <param name="writer">The writer to write to.</param>
87
91
/// <param name="source">The mapped query to read.</param>
88
-
/// <param name="stallTimeout">The longest the writer may make no room while the reader is held. Required; passed to <c>Stream</c>.
92
+
/// <param name="stallTimeout">The longest the writer may make no room while the reader is held. Required; passed to <see cref="IMappedQuery{T}.StreamBuffered(TimeSpan, int, CancellationToken)"/> with a buffer of one row.
89
93
/// The wait for room before the command runs is not timed.</param>
/// <param name="writer">The writer to write to.</param>
109
113
/// <param name="source">The mapped query to read.</param>
110
-
/// <param name="stallTimeout">The longest the writer may make no room while the reader is held. Required; passed to <c>Stream</c>.
114
+
/// <param name="stallTimeout">The longest the writer may make no room while the reader is held. Required; passed to <see cref="IMappedQuery{T}.StreamBuffered(TimeSpan, int, CancellationToken)"/> with a buffer of one row.
111
115
/// The wait for room before the command runs is not timed.</param>
112
116
/// <param name="complete">
113
117
/// <see langword="true"/> to complete the writer when the pass ends,
/// <see cref="ConnectionExtensions.EnsureOpenScopeAsync(IDbConnectionPool, CancellationToken)"/> (on a pool)</term>
54
-
/// <description>The pool leased it; gives it back with <see cref="IDbConnectionPool.Give(IDbConnection)"/>, as
55
-
/// <c>pool.Open(...)</c> does. What giving back means (close it, keep it, dispose it) is the pool's.</description>
56
-
/// </item>
30
+
/// What disposing the scope does depends on where the connection came from:
31
+
/// <list type="bullet">
32
+
/// <item><description>From <c>EnsureOpenScope</c> on a connection: closes it if the scope opened it; never disposes it.</description></item>
33
+
/// <item><description>From <c>EnsureOpenScope</c> on a factory: disposes it (<c>DisposeAsync</c> when it has one).</description></item>
34
+
/// <item><description>From <c>EnsureOpenScope</c> on a pool: gives it back with <see cref="IDbConnectionPool.Give(IDbConnection)"/>; what that means is the pool's.</description></item>
57
35
/// </list>
58
-
/// <para>
59
-
/// When you already hold the connection the scope is usually only there to be disposed:
60
-
/// </para>
61
-
/// <code language="csharp">
62
-
/// await using var _ = await connection.EnsureOpenScopeAsync(cancellationToken);
63
-
/// // ... use the connection you already hold.
64
-
/// </code>
65
-
/// <para>
66
-
/// When the connection came from a factory or a pool the scope is how you get it:
67
-
/// </para>
68
-
/// <code language="csharp">
69
-
/// await using var scope = await factory.EnsureOpenScopeAsync(cancellationToken);
70
-
/// var connection = scope.Connection;
71
-
/// </code>
72
-
/// <para>
73
-
/// The scope keeps the type of the connection (a <c>SqlConnection</c> stays a
74
-
/// <c>SqlConnection</c>), and deconstructs into the connection and the state it was found in:
75
-
/// <c>var (sql, was) = scope;</c>.
76
-
/// </para>
77
-
/// <para>
78
-
/// A connection that was broken is closed and opened again, so a scope that closes it closes it
79
-
/// again afterwards; the broken state is not restored.
80
-
/// </para>
81
-
/// <para>
82
-
/// Dispose the value you were given exactly once, and do not copy it: a second dispose of a copy
83
-
/// disposes a factory's connection again, gives a pool's connection back again, or closes a connection
84
-
/// that someone opened in between. Deconstruct a scope you hold, never the call itself:
85
-
/// <c>var (c, s) = connection.EnsureOpenScope();</c> drops the scope, and the connection it opened
86
-
/// stays open.
87
-
/// </para>
88
-
/// <para>
89
-
/// A <see langword="default"/> scope holds nothing: disposing it does nothing, and
Copy file name to clipboardExpand all lines: Source/Core/Core/NullPolicy.cs
+5-15Lines changed: 5 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ public enum NullAction
16
16
/// <remarks>
17
17
/// The same as no policy. On a member it overrides the type's policy, so one hot member can opt out.
18
18
/// A NULL into a nullable member is <see langword="null"/>;
19
-
/// into a non-nullable one it surfaces as the provider's own exception inside a <see cref="ValueMappingException"/> that names the model type and, when the row is known, the row (the member and the column are not known).
19
+
/// into a non-nullable one it throws <see cref="ValueMappingException"/> naming the model type andthe row, not the member or the column.
20
20
/// To find which member and column, use <see cref="Throw"/>.
21
21
/// </remarks>
22
22
/// <seealso cref="Throw"/>
@@ -50,21 +50,11 @@ public enum NullAction
50
50
/// Declares what a NULL does to a member when a row is mapped: on the model type for every member, or on one member.
51
51
/// </summary>
52
52
/// <remarks>
53
-
/// <para>
54
53
/// A policy always applies, nullable members included.
55
-
/// On the type it covers every member, and a member's own policy overrides it (<see cref="NullAction.None"/> included).
56
-
/// A <see cref="NullValueAttribute"/> on a member overrides any policy, the member's own included.
57
-
/// A positional record's parameter takes the policy on the parameter or on its property.
58
-
/// A pair or a converter of a <see cref="RowMap{T}"/> that names the member is explicit and overrides the member's own declarations in that map (the type's policy still covers it);
59
-
/// a converter whose column type is a <see cref="Nullable{T}"/> receives the NULL itself, and no policy applies.
60
-
/// A converter whose column type is a reference type (<see cref="string"/>) is not called for a NULL; the member then follows the NULL rules and the type's policy.
61
-
/// A policy on a base type covers a derived model's members. The nearest declaration wins: the derived type's own policy, then its base type's;
62
-
/// a member's own policy beats both, and a <see cref="NullValueAttribute"/> beats all.
63
-
/// The declarations are read once per type, when its slots are built.
64
-
/// </para>
65
-
/// <para>
66
-
/// Every check costs one NULL test per covered member per row. A member with no policy is not checked (<see cref="NullAction.None"/>).
67
-
/// </para>
54
+
/// On the type it covers every member, and a policy on a base type covers a derived model's members.
55
+
/// A member's own policy overrides the type's, and a <see cref="NullValueAttribute"/> on a member overrides any policy.
56
+
/// A member with no policy is not checked (<see cref="NullAction.None"/>).
57
+
/// See <see href="https://open-net-libraries.github.io/Open.Database.Extensions/articles/mapping.html#null-policy">Null policy</see>.
0 commit comments