Entity Framework not working with temporal table

c# entity-framework-6 sql-server sql-server-2016 temporal-database

Question

Database First Entity Framework 6 is what I'm utilising. I began receiving the following problem while trying to insert new data after making some of the tables in my schema temporal tables:

Cannot insert an explicit value into a GENERATED ALWAYS column in table '<MyDatabase>.dbo.<MyTableName>. Use INSERT with a column list to exclude the GENERATED ALWAYS column, or insert a DEFAULT into GENERATED ALWAYS column.

It seems like EF is attempting to update the values ofPERIOD columns that the system controls.

The issue seems to be resolved by removing the columns from the EDMX file, however this is not a workable fix since the columns are inserted again each time the model is built from the database.

1
15
11/22/2016 12:40:03 PM

Accepted Answer

ZZZ_tmp
22
8/2/2019 7:08:32 PM

Popular Answer

ZZZ_tmp


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow