I'm using the DropCreateDatabaseIfModelChanges initializer for the database.
Some simple example code looks like this:
Code: Select all
using (var context = new MyDbContext())
{
var item = context.Items.Create();
item.Name = "Yo";
context.Items.Add(item);
context.SaveChanges();
}
SQLiteConnection.ClearAllPools(true);
File.Delete("MyDbContext.db");
using (var context = new MyDbContext())
{
var item = context.Items.Create();
item.Name = "Yo";
context.Items.Add(item);
context.SaveChanges();
}
System.Data.Entity.Infrastructure.DbUpdateException: An error occurred while updating the entries. See the inner exception for details.
Devart.Data.SQLite.SQLiteException: SQLite error\r\nno such table: Items
It correctly recreates the database file, but adds no schema. Why?
Thanks for your help!
Eric