Repository navigation
Document how to read several result sets, and when to use Map<T>() or Results<T>() - #87
Merged
electricessence merged 1 commit intoNov 9, 2026
Conversation
…provider and Never-NextResult tests A new page shows how to read several result sets with the caller's NextResult, including the SQL Server error that follows the rows. mapping.md compares Map<T>() and Results<T>(); foundation.md no longer says Results<T>() queues rows. XML docs say the reader-level mappers read the current set only. No library behavior or public API changes. 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.
Builds on #85: merge that one first.
The library still reads one result set per call; this change documents how to read several yourself, and adds tests for it.
several-result-sets.md: the sync and async pattern (ExecuteReader, map,NextResult, map), the same on a connection you set up yourself, a loop for an unknown number of sets, unknown shapes (FieldCount,GetName,AsEnumerable,ToDataTables), the rules, and why the library does not do it for you. Every code block runs in the sample checks.RAISERRORafter aSELECT): it reaches you only whenNextResultmoves past that set. A table lists the measured cases, and the page shows the one-call check.mapping.mdhas a new "Map<T>()orResults<T>()" section: a table by where you call it (when rows are read, when the connection is released, what you get back), and whyResults<T>exists. Its old "Several result sets" section is now a pointer to the new page.foundation.mdis corrected:Results<T>()maps every row during the call and releases the connection; only theDataTablepath queues rows first.coming-from-dapper.mdandwhats-new-11.mdlink to the new page.Source/: one sentence onMap<T>and the reader-levelResults<T>,ResultsAsync<T>,ResultsBuffered<T>andResultsBufferedAsync<T>that they read the current result set and never move to the next.NextResult, and an error after the rows (Map<T>().ToList()returns the rows; the caller'sNextResultthrowsSqlException); skipped where LocalDB is missing. InNeverNextResultTests:ToTargetBlockon a command, and theFirstOrDefaultcases now use three rows and assert only one row was read.🤖 Generated with Claude Code