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
First, I found that the primary key cannot be inserted. The primary key does not support insertion (it must rely on mysql to automatically process the value. If it is not set, an exception will be thrown if the default value is not set).
Second, there seems to be some problems with data types. MySQL defines the column as int, but C # prompts that I cannot convert the exception of type int64 to int32.
@alexpantyukhin I am now using another ORM framework and basically have no problems. It seems that the primary key is affected to the detriment of inserting data into it, even if it is the primary key for only one field. As for the rest I don't know much about it.
Hello! Thank you for the great lib!
I have an issue with
Insert
function.I have an
Entity
with 2 not null primary keys:So there is the composite key for OtherEntityId and OtherEntityField.
When I try to put it into the DB:
I got an error: Cannot insert the value NULL into column 'OtherEntityId', table 'DB.dbo.TicketField'; column does not allow nulls. INSERT fails.
I think that it's because of these lines of code: https://github.com/tmsmith/Dapper-Extensions/blob/master/DapperExtensions/Sql/SqlGenerator.cs#L228 . It skips the primary keys values. It would be good if the lib checks if fields of the DB set up
not null
value and allow to put values into theinsert
command.The text was updated successfully, but these errors were encountered: