title: auto create database in Entity Framework Core
body: <p>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 first run. According to the EF core documentation this is done using manual commands </p>
  
  <pre><code>dotnet ef migrations add MyFirstMigration
  
  dotnet ef database update
  </code></pre>
  
  <p>However I don't want the end user to enter these commands and would prefer to have the app create and setup the database for first use. For EF 6 there is functionality like </p>
  
  <pre><code>Database.SetInitializer(new CreateDatabaseIfNotExists&lt;MyContext&gt;());
  </code></pre>
  
  <p>But in EF Core these don't seem to exist. I can't find any examples or documentation on something equivalent for EF core and it is not mentioned in the list of missing features in the EF core documentation. I have the model classes setup already so I could write some code to initialize the database based on the models but it would be heaps easier if the framework did this automatically. I don't want to auto build the model or migrate, just create the table structures on a new database.</p>
  
  <p>Am I missing something here or is auto create table function missing in EF core?</p>