I'm working to move our model over to EF Core and I'm having trouble finding a way to call the following code:
InitializeTime = context.ExecuteSqlCommand<DateTime>("SELECT CURRENT_TIMESTAMP FROM DUAL").FirstOrDefault();
We use the database time to synchronize everything but from what I can find calling raw sql outside a DbSet isn't available and the return type is restricted to the DbSet
type argument.
I was looking around and found that there are DbQuery
objects (Article) but that seems like heavy lifting just to get the current system date time.
Has anyone else come across this and found a easier solution?
Note: this is a desktop application so the code would be running client side and the system date time isn't reliable.