Repository navigation
Source: remove the eight Map<T>(pair...) overloads; Map(new RowMap<T>(pairs)) is the one way - #151
Merged
Merged
Conversation
…tead The single-pair and params-pair Map<T> overloads on IExecuteReader (shipped), IDataReader, IDbCommand and DataTable (unshipped) are removed. A pair belongs in a RowMap<T>, so the cost of building a map and compiling its reader on every call is visible at the call, and declaring the map once is the way to avoid it. Map(new RowMap<T>(pair, ...)) is the replacement for a one-off. Map<T>(null) now binds Map(RowMap<T>?) on C# 13 and 14 (it was the params overload); it was already ambiguous on C# 12. The no-argument Map<T>() and the RowMap<T> constructors are untouched. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The LegacyCompiler binding tests now run on every target (C# 7.3, 9, 12 and 13), with null, default and [] kept to C# 13. A stale RowMapTests comment about pairs passed to Map<T> is reworded. whats-new-11 lists the run-time change of Map<int>([]), and a grammar fix in mapping.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nt in mapping.md The previous docs commit merged the Map<int>([]) note into item 13 and dropped item 14. Items 13 and 14 are back as they were, the note is item 15, and mapping.md reads "builds a new map, and compiles the row reader". Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
electricessence
marked this pull request as ready for review
November 16, 2026 01:09
electricessence
marked this pull request as draft
November 16, 2026 01:35
electricessence
marked this pull request as ready for review
November 16, 2026 01:37
…70 columns The MapCallSite and MapPairs samples are async (ToArrayAsync with a token) and write each pair on its own line. The 10.x and 11 snippet in whats-new-11 awaits the async call on both sides, with the pairs vertical. Comments this PR added or changed are broken at natural breaks near 70 columns. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Removes the eight
Map<T>(pair…)overloads: on each of the four receivers (IExecuteReader,IDataReader,IDbCommandandDataTable) the single-pair form and theparams ReadOnlySpan<KeyValuePair<string, string?>>form.Map<T>(…, RowMap<T>? map)is the one way to pass a map; the replacement for a pair list isMap(new RowMap<T>(pairs)).Map<T>(null)overload resolution; the removal keepsMap<T>()andMap(RowMap<T>?)as the one typed entry.*REMOVED*lines for shipped members (the single-pair and params forms of the shipped receiver) and six lines deleted from the unshipped list. No overload is added.Map<T>(null)andMap<T>(default)now bind toMap(RowMap<T>?)on all four receivers, with no new ambiguity. On C# 12 they were already ambiguous before this change, because the overload-priority attribute is ignored there. A collection expression still converts toRowMap<T>through its collection builder and bindsMap(RowMap<T>?); onlyMap<T>(pair)andMap<T>(pair, pair)stop compiling.Map<int>([])(an empty collection expression for a single-value type) used to read the first column through the params form; it now builds aRowMap<int>and throwsInvalidOperationException("a single value, not a row model").Map<Person>([])is unchanged. One parity test now asserts the throw; two tests that covered the old behaviour are deleted.Map(new RowMap<T>(pairs))(10 test files, the docs-site sample,mapping.mdandwhats-new-11.md). The internal row-source seam andMap<T>()'s final call are untouched.Checks
🤖 Generated with Claude Code