Skip to content

Database Creation

Todd Thomson edited this page Aug 25, 2018 · 2 revisions

Database Creation

Entities.Sqlite provides code-first database creation based on your data context entity model.

After creating your data context call context.Database.Creator.CreateIfNotExists() to create your database.

using ( var context = new YourDataContext( options ) )
{
    var createResult = context.Database.Creator.CreateIfNotExists();
    
    ...
}

Features

Entities.Sqlite provides the following database creation features:

  • Memory and File data sources
  • Column constraints
  • Indexing
  • Foreign key constraints