I have a project which saves its output results into an SQLite database.
in every run, the user should select the saving location which the program will create a database there and will save the result inside. so the database's name and location are dynamic.
How can I manage such a thing using entity framework core code first? I have create the models and the DbContext class, but I do not know how to create the database and tables on runtime and so on.
Context.Database.EnsureCreated();will create a database if not createdYou need to call SQLitePCL.raw.SetProvider(). If you are using a bundle package, this is done by calling SQLitePCL.Batteries.Init().'Don't call EnsureCreated() before Migrate(). EnsureCreated() bypasses Migrations to create the schema, which causes Migrate() to fail