Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Table Properties are Ignored #160

Open
alamb3142 opened this issue Sep 5, 2023 · 0 comments
Open

Internal Table Properties are Ignored #160

alamb3142 opened this issue Sep 5, 2023 · 0 comments

Comments

@alamb3142
Copy link

alamb3142 commented Sep 5, 2023

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.

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

No branches or pull requests

1 participant