Skip to content

GetAsync fails on SQL Server when the primary key property is a reserved SQL keyword #150

@ghills

Description

@ghills

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions