I created a DbContext like so :
public class myDB : DbContext
{
public DbSet Parties { get; set; }
public DbSet B
I believe you're looking for:
Database.SetInitializer(new DropCreateDatabaseIfModelChanges());
As of EF 4.1 and above.
Note that this assumes you have permission to even drop your database. I do this locally for ease of development but disable it in staging/production (I do a manual Schema Compare and push my changes).
By the way, for testing, if you need to force recreate the database, you can do:
using (var context = new ClubmansGuideDB()) {
context.Database.Initialize(force: true);
}
(using
if you don't already have a reference to your DB)