4

Temporal tables are awesome and the implementation is simple, so I love them!

But, I have a concern regarding deletion of history in temporal tables.
I cannot find how to do that.

Why would I do that?
Because I'm implementing temporal tables in my software, and want to ensure that when I say to my clients that I've deleted their data, I've actually deleted it, instead of having a history of it.

The 'save history of changes' is meaningful to my clients, as long as they are using the software. I want to ensure that when they want to stop using the softwar and if they want to delete all their data they can do that.

I'm using .NET 6 with EFCore and MSSQL DB.

How do you remove rows from temporal table's history table via EFCore?

marsze
  • 15,079
  • 5
  • 45
  • 61
Monset
  • 648
  • 5
  • 25
  • 4
    I suppose you will have to use raw SQL queries for this, as here: https://stackoverflow.com/q/53746197/5045688. You can map some method to SQL like this: [User-defined function mapping](https://learn.microsoft.com/en-us/ef/core/querying/user-defined-function-mapping) – Alexander Petrov Jul 05 '22 at 13:48

0 Answers0