I'm using SQLite and Entity Framework code-first. And my Windows desktop application needs the ability to Create and Open files.
For creating a database, I found DbContext.Database.Migrate()
, which will create the database if needed, and them make the schema current.
For opening a database, I'm not as certain. I may try to automatically updated it, but I might also prompt the user before doing so.
I found DbContext.Database.GetMigrations()
, but how would I use that to determine if the database file is already current?