Skip to content

Document compiler visibility for the SQL syntax property - #231

Open
dajiaohuang wants to merge 1 commit into
DapperLib:mainfrom
dajiaohuang:docs/sqlsyntax-compiler-property-20261016
Open

dajiaohuang wants to merge 1 commit into
DapperLib:mainfrom
dajiaohuang:docs/sqlsyntax-compiler-property-20261016

Conversation

@dajiaohuang

Copy link
Copy Markdown

Problem

SQL Syntax option 4 currently says setting Dapper_SqlSyntax in a PropertyGroup is enough. In a NuGet consumer, that MSBuild property is not automatically visible to the analyzer: GlobalOptions reads build_property.Dapper_SqlSyntax, which requires a CompilerVisibleProperty item.

The repository itself already supplies the item in Directory.Build.props, but consumers do not inherit that file.

Change

Show the complete project-file configuration, including the compiler-visible item, and explain why it is needed. No analyzer or package behavior changes.

Validation

Built a standalone net10.0 library using Dapper.Advisor 1.1.0 and Dapper 2.1.79. Its synthetic DbConnection.QueryFirst<Product>("select * from Products where Id = @id", new { id = 7 }) call gives no SQL Server diagnostic with the property alone. Adding the documented item makes the same build report DAP219 as expected. This was compilation-only; no SQL Server connection or real database was used.

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