Skip to content

Instantly share code, notes, and snippets.

@christiannagel
Created August 28, 2018 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiannagel/8d75e407fbd166774b5efe3e1665c33c to your computer and use it in GitHub Desktop.
Save christiannagel/8d75e407fbd166774b5efe3e1665c33c to your computer and use it in GitHub Desktop.
Using the BooksContext to create the database and seed data
using (var context = new BooksContext())
{
bool created = context.Database.EnsureCreated();
Console.WriteLine($"Books database created and seeded: {created}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment