My application which is being ported to .NET core will use the new EF Core with SQLite. I want to automatically create the database and table structures when the app is firs
If you haven't created migrations, there are 2 options
1.create the database and tables from application Main:
var context = services.GetRequiredService();
context.Database.EnsureCreated();
2.create the tables if the database already exists:
var context = services.GetRequiredService();
context.Database.EnsureCreated();
RelationalDatabaseCreator databaseCreator =
(RelationalDatabaseCreator)context.Database.GetService();
databaseCreator.CreateTables();
Thanks to Bubi's answer