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 4411d88
Browse filesBrowse the repository at this point in the historyBrowse files
rc.4: Map<T>() on a reader or a raw command (MappedReader<T>, MappedCommand<T>) (#117)
* Map<T>() of a single value reads the first column, and a command has async terminals that take the type
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Tests pin the first-column read of a single value, the async terminals of a command and their binding
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* The docs and samples show Map<int>() and ToArrayAsync<int>(ct) reading one column
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* The command terminals follow the vertical style: one parameter per line, => on its own line, doc comments wrapped at natural breaks
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Braces on the multi-line if and else bodies the vertical style created (IDE0011)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Braces on the if that pairs with the braced else (IDE0011)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* reader.Map<T>() and command.Map<T>(): mapped views over a caller's reader or command
A null map, an empty pair list and a default struct behave as documented.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Tests for the reader and command Map views
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Docs and samples for the reader and command Map views
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* PublicAPI: the default constructors of the two views are named for their own types
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Fix the test build and the style findings of the view tests and sources
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Fix the view build on netstandard, the null-map deprecation tests and two view tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
* Expression body for the Command property (IDE0025)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Blank lines between members, PublicAPI order
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Views: dispose the reader with ConfigureAwait(false), a cancelled token gives a cancelled task, document Read() and the CS0121 ambiguity
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: Source/Core/MappedQuery.cs
+32-19Lines changed: 32 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,8 @@ public static partial class CoreExtensions
29
29
/// </para>
30
30
/// <para>
31
31
/// Pass a <see cref="RowMap{T}"/> to read columns whose names differ from the properties; the overload without a map reads by column name.
32
+
/// Columns match a property exactly, else ignoring case, else ignoring case and underscores (<c>author_id</c> feeds <c>AuthorId</c>);
33
+
/// the resolved layout is cached per result-set layout.
32
34
/// Declare the <see cref="RowMap{T}"/> once and pass it: a map built in the call (a <c>new RowMap<T>(...)</c> or a collection expression in the argument) is rebuilt, and its row reader compiled, on every call
33
35
/// (about 29 KB and a reader compile for a one-row read of a 12-property model, against 464 B through a declared map; see
34
36
/// <see href="https://open-net-libraries.github.io/Open.Database.Extensions/articles/mapping.html#columns-named-differently">Columns named differently</see>).
@@ -42,20 +44,24 @@ public static partial class CoreExtensions
42
44
/// </remarks>
43
45
/// <typeparam name="T">The model type to map the values to.</typeparam>
44
46
/// <param name="command">The command to read from.</param>
45
-
/// <param name="map">The prebuilt <see cref="RowMap{T}"/> to read with.</param>
47
+
/// <param name="map">The prebuilt <see cref="RowMap{T}"/> to read with; <see langword="null"/> reads as <c>Map<T>()</c> does (before 11.0.0-rc.4 it threw).</param>
46
48
/// <returns>A deferred query whose results are mapped to <typeparamref name="T"/>.</returns>
47
-
/// <exception cref="ArgumentNullException"><paramref name="command"/> or <paramref name="map"/> is <see langword="null"/>.</exception>
49
+
/// <exception cref="ArgumentNullException"><paramref name="command"/> is <see langword="null"/>.</exception>
// One token governs a whole call: the one passed to the terminal together with the command's own (either cancels), for the connection open, the name lookup, the execute and the reads.
156
169
// No token, one token, or the same token twice needs no source, so those calls allocate nothing for it. Two different tokens need a linked source, which the call disposes when it ends.
0 commit comments