static void Main(string[] args) { using (var db = new BloggingContext()) { db.Database.EnsureDeleted(); db.Database.EnsureCreated(); } }
static void Main(string[] args) { using (var db = new BloggingContext()) { Console.WriteLine("Recreating database from current model"); Console.WriteLine(" Dropping database..."); db.Database.EnsureDeleted(); Console.WriteLine(" Creating database..."); db.Database.EnsureCreated(); } }