How to auto create database on first run?
16:42 20 Feb 2017

My application being ported to .NET Core will use EF Core with SQLite. I want to automatically create the database and tables when the app is first run. According to documentation this is done using manual commands :

dotnet ef migrations add MyFirstMigration

dotnet ef database update

I don't want end user to enter these but prefer the app to create and setup the database on first use. For EF 6 there is :

Database.SetInitializer(new CreateDatabaseIfNotExists());

But I can't find any equivalent for EF Core. I have the model classes already so I could write code to initialize the database based on the models but it would be easier if the framework did this automatically. I don't want to auto build the model or migrate, just create the tables in a new database.

Is an auto create table function missing from EF Core?

c# sqlite .net-core entity-framework-core