Repository navigation
Docs: Coming from Dapper, side by side and aligned, led by the connection factory - #39
Merged
Merged
Conversation
…-side comparisons - The Dapper article now opens with the connection: who creates, opens and disposes it. Dapper opens a closed connection for plain queries (SqlMapper.cs, wasClosed); ADO.NET needs an open connection to begin a transaction. Each comparison has the same rows in the same order (connection, command, parameters, terminal), a per-call line tally taken from the compiled snippets, and a short list of behavior differences. Covers a list, one row, a scalar, a command with no result set, a transaction and a connection you own. - A reusable two-column component (templates/custom/public/main.css, .side-by-side) is used by Getting started (factory versus own connection, plain ADO.NET versus the extensions) and Expressive commands (factory versus connection form). - docsite/samples/ConnectionPattern.cs holds the compared snippets, the one-time factory setup and a dependency-injection example; Program.cs checks that both sides agree. NOT BUILT OR RUN YET: written during a benchmark window. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Each column is a subgrid over two shared rows (heading, code), so the code blocks start on the same line even when one heading wraps (the "own connection" heading wrapped and pushed its code down 24 px). Checked in the browser at 1100 px and 375 px, light and dark: all six comparisons align, highlighting works, the columns stack under 768 px and the page does not overflow. 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.
Reworks "Coming from Dapper" around the thing that actually differs: who handles the connection. Every comparison is now side by side and aligned row against row, with the SQL predefined once above so the lines stay short.
SqlMapper.cs,DefaultTypeMap.cs,CommandDefinition.cs); every ODE statement against the code or a test.Open()is optional there; ADO.NET requires an open connection to begin a transaction, so transaction code opens it explicitly, and the ODE transaction helpers open it for you and close only what they opened.docsite/samples/ConnectionPattern.cs(compiled and run by the build: 51 checks pass, 0 warnings). The README is untouched; it will link to these comparisons after the pending mapping PR merges.Verified locally: DocFX 0 errors (231 warnings, all the known duplicate-parameter ones from XML docs in other branches, none from this content), 5,937 relative links and 2,059 anchors checked with none broken, two columns aligned at 1100 px and stacked at 375 px, light and dark. Screenshots below. The
Docscheck builds the site on this PR.🤖 Generated with Claude Code