I have an application using EF 4.1 (using the model-first flavour), and I want to initialize the database when the model is updated and the database is dropped and re-created.
I've spent hours trying to find decent documentation on this, and I thought that Database.SetInitializer was the way to go, but it turns out that this requires a DbContext, and the code that's been generated uses ObjectContext.
I believe that I can fiddle about under the hood to switch the T4 templates to use DbContext, but surely there must be a way to work with the out-of-the-box model-first generated code?
[Should I just abandon model-first altogether?]