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.
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.