How to call Database.SetInitializer on model-first?
问题 I created a model in the edm designer (VS10) using "DbContext Entity Generator" as the generation item. In the generated DbContext subclass, it overrode the constructor so I can't use it in the other partial class: public EntitiesContainer() : base("name=EntitiesContainer") { this.Configuration.LazyLoadingEnabled = false; } What's the proper way of initialize a database with model-first? 回答1: You could alter the T4 template that's being used for generating the DbContxt class. Then you could