You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sql=$"SELECT * FROM {name} WHERE {key.Name} = @id";
The query building for Get/GetAsync do simple string formatting to include the property name for the primary key of the table instead of formatting the escaped column name.
For example, a property named Key with the ExplicitKeyAttribute should work but fails because KEY is a reserved SQL keyword. The column name should be included as WHERE [Key] = @id instead.
The text was updated successfully, but these errors were encountered:
Dapper.Contrib/src/Dapper.Contrib/SqlMapperExtensions.Async.cs
Line 33 in cf24f6b
The query building for
Get
/GetAsync
do simple string formatting to include the property name for the primary key of the table instead of formatting the escaped column name.For example, a property named
Key
with theExplicitKeyAttribute
should work but fails becauseKEY
is a reserved SQL keyword. The column name should be included asWHERE [Key] = @id
instead.The text was updated successfully, but these errors were encountered: