If I have this project structure
Isn't that supposed to allow me to prevent adding a reference to EntityFramework from Foo.Web?
How can I call System.Data.Entity.Database.SetInitializer()
from my global.asax.cs
without adding the EntityFramework reference?
What you can do is create a InitializeDatabase()
function in your Foo.Business
project which in-turn calls System.Data.Entity.Database.SetInitializer()
. You can then call InitializeDatabase()
from your Foo.Web
project which already has a reference to Foo.Business