How do I add Oracle Flashback columns to a .Net Core Entity Framework EDMX on affected entities?

104 Views Asked by At

During development of a .Net Core EF app, the DBAs implemented Oracle Flashback, which is queried by addressing the table being audited instead of a manual join to another table. How do I add these columns to the EDMX files so that the app may query them and present results? Simply refreshing the EDMX doesn't bring in the Flashback information.

1

There are 1 best solutions below

0
David Browne - Microsoft On BEST ANSWER

You'll need to run Raw SQL Queries. Eg

using (var context = new BloggingContext())
{ 
    var sql = "SELECT * FROM dbo.Blogs AS OF TIMESTAMP TO_TIMESTAMP('2021-03-29 13:34:12', 'YYYY-MM-DD HH24:MI:SS')";
    var blogs = context.Blogs.SqlQuery(sql).ToList();
}