Entity Framework not working with temporal table

后端 未结 5 1850
北海茫月
北海茫月 2020-12-03 07:37

I\'m using database first entity framework 6. After changing some of the tables in my schema to be temporal tables, I started getting the following error when attempting to

5条回答
  •  甜味超标
    2020-12-03 08:05

    Making the Period start column (ValidFrom) and Period end column (ValidTo) should fix this issue. We can do this by

    ALTER TABLE [dbo].[Table1] ALTER COLUMN [ValidFrom] ADD HIDDEN;
    ALTER TABLE [dbo].[Table1] ALTER COLUMN [ValidTo] ADD HIDDEN;
    

    We can see the settings for hidden against these columns in the sys.columns table

    SELECT * FROM sys.columns WHERE is_hidden = 1
    

提交回复
热议问题