David
David

Reputation: 733

SQL Temporal Tables and EF Code First Migrations

I commented here (https://github.com/aspnet/EntityFramework/issues/4693) regarding bringing temporal table support to EF - in particular Code first.

Would anyone have a solution as to how I could achieve this whilst its not supported? I really dont want to remove our pure code first approach, so setting up the table(s) for temporal storage via code is ideal.

One way I guess is to do a helper method in the repository layer code to spit out the SQL query I need. Just add a blank migration and then the relevent SQL commands??

What do you guys think?

Upvotes: 2

Views: 920

Answers (1)

JimbobTheSailor
JimbobTheSailor

Reputation: 1613

EF Core 6.0 now has full support for code first Temporal Tables. See https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-6.0/whatsnew

Upvotes: 2

Related Questions