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
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: