Skip to content

Internal Table Properties are Ignored #160

Description

@alamb3142

This wasn't clear from the docs, but these methods don't appear to map internal properties to column names, only the public ones. I got the following error trying to call InsertAsync<T> on an internal model:

Exception thrown: 'System.Data.SqlClient.SqlException' in System.Private.CoreLib.dll: 'Incorrect syntax near ')'.'

It turns out that the property -> column mapping is calling Type.GetProperties(), which returns only public properties by default, which was generating the follow query:

INSERT INTO dbo.my_table () values (); SELECT SCOPE_IDENTITY() id

I've raised #159 to allow these models to be marked as internal without having to override that modifier on all of the table class's properties.

Activity

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

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