Skip to content

Source generator: ships in the Core package, on by default - #267

Merged
electricessence merged 1 commit into
masterfrom
feat/generator-in-core
Nov 30, 2026
Merged

electricessence merged 1 commit into
masterfrom
feat/generator-in-core

Conversation

@electricessence

Copy link
Copy Markdown
Collaborator

The Map<T>() source generator is now part of Open.Database.Extensions.Core:
the analyzer, built for Roslyn 4.14 or later so an older compiler never loads
it, and the build targets that allow its interceptors. The other packages pass
both on to their consumers. <OdxGenerateMaps>false</OdxGenerateMaps> switches
it off, and holds even where the compiler does not receive the property.

A partial model (or one with a partial base type) is checked once against the
built type: if another source generator added constructors or settable
properties this one could not see, the runtime map reads it, so no column is
left unset.

Fixed before it ships: on machines whose culture writes a minus sign C# does not
read (Swedish, Norwegian, Persian and others), the generated file did not
compile.

A new test project references only the packed packages and runs the generator
on, through MSSqlClient alone, switched off, and on C# 12, for net472, net10.0
and net11.0, against SQL Server LocalDB and a SQLite file. The generator CI job
starts LocalDB, requires it, and runs those tests. Also adds tests for more
declined and served model shapes.

Documentation: a "Generated readers" section in the mapping article, the Core
and generator READMEs, and a release note.

🤖 Generated with Claude Code

The `Map<T>()` source generator is now part of `Open.Database.Extensions.Core`:
the analyzer, built for Roslyn 4.14 or later so an older compiler never loads
it, and the build targets that allow its interceptors. The other packages pass
both on to their consumers. `<OdxGenerateMaps>false</OdxGenerateMaps>` switches
it off, and holds even where the compiler does not receive the property.

A partial model (or one with a partial base type) is checked once against the
built type: if another source generator added constructors or settable
properties this one could not see, the runtime map reads it, so no column is
left unset.

Fixed before it ships: on machines whose culture writes a minus sign C# does not
read (Swedish, Norwegian, Persian and others), the generated file did not
compile.

A new test project references only the packed packages and runs the generator
on, through MSSqlClient alone, switched off, and on C# 12, for net472, net10.0
and net11.0, against SQL Server LocalDB and a SQLite file. The generator CI job
starts LocalDB, requires it, and runs those tests. Also adds tests for more
declined and served model shapes.

Documentation: a "Generated readers" section in the mapping article, the Core
and generator READMEs, and a release note.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@electricessence
electricessence merged commit 19369e4 into master Nov 30, 2026
10 checks passed
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