Why do you want?
The reason you do this decoupling is (I suppose) so that you can switch the data layer at a later stage without changing anything in the web project and as little as possible in the business project. To achieve this, you must ensure that all of your classes work against interfaces, and not against specific implementations.
In your example, you probably should define some kind of Repository interface that includes the Initialize() method. Then you create a class (perhaps your specialized DbContext) that implements the interface, and you work against it. In the Initialize() method in your repository, you call Database.SetInitializer() , and so you never need to reference System.Data.Entity in web or business projects.
source share