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
Hi, I'm having an issue where EF6 context.Entity.Add(entity) not auto-incrementing its Primary Key after inserting the data.
I'm currently using the following nuget packages in a .NET Framework 4.8 project:
'------------------------------------------------------------------------------' <auto-generated>' This code was generated from a template.'' Manual changes to this file may cause unexpected behavior in your application.' Manual changes to this file will be overwritten if the code is regenerated.' </auto-generated>'------------------------------------------------------------------------------ImportsSystemImportsSystem.Collections.GenericPartialPublicClassErrorLogPublicPropertyErrorLogIdAsIntegerPublicPropertyErrorDetailsAsStringPublicPropertyDateCreatedAsDateEndClass
@chinyik94 just to make sure you know that the EF6 provider is archived, and there's nobody regularly answering questions here. Someone from the community may be able to help though.
Hi, I'm having an issue where EF6
context.Entity.Add(entity)
not auto-incrementing its Primary Key after inserting the data.I'm currently using the following nuget packages in a .NET Framework 4.8 project:
\d "ErrorLog"
:Minimum reproduceable repo can refer to: https://github.com/chinyik94/NpgsqlSample
Entity model file:
Adding new data to entity:
Expected:
ErrorLogId = 1, ErrorDetails = "Test Error", DateCreated = Now
Actual:
ErrorLogId = 0, ErrorDetails = "Test Error", DateCreated = Now
I also tried using negative ID as recommended in npgsql/efcore.pg#1391, but the Primary Key inserted is -1 instead if I provide the value.
The text was updated successfully, but these errors were encountered: