Skip to content

Fix list initializer in bulk Execute README example - #2243

Open
dajiaohuang wants to merge 1 commit into
DapperLib:mainfrom
dajiaohuang:docs/fix-readme-bulk-list-20261016
Open

dajiaohuang wants to merge 1 commit into
DapperLib:mainfrom
dajiaohuang:docs/fix-readme-bulk-list-20261016

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem

The existing-collection example in “Execute a Command multiple times” does not compile. Copying its var foos = new List<Foo> { ... }; initializer into a console project, with a Foo class exposing A and B, reports CS1003 at the first two entries. Each entry has an extra pair of initializer braces and the entries lack separating commas.

Change

Use three comma-separated new Foo { ... } elements. No API or runtime changes.

Validation

  • Original initializer extracted verbatim from Readme.md: compilation fails with CS1003.
  • Corrected initializer: compiles and prints a count of 3 (.NET SDK 10.0.100, net10.0).
  • Core Dapper Release/net10.0 build: 0 warnings/errors, invoked outside the checkout because the installed SDK is older than the pinned 10.0.102.
  • Standalone in-memory SQLite checks against the built library pass, including bulk Execute using this list (three inserted rows). SQLite-compatible INSERT syntax and exact-case parameter names were used; this is not a SQL Server test.

The database-dependent native test suite was not run. The change is limited to the three README initializer lines.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant