Asp.Net Identity, Web Project and DAL Layer
Today I need some kind of suggestion with one of the problems I am currently struggling with
I am working on a project that has 3 layers
1) DAL
2) BAL
3) Web
4) Entities (This is a separate project which contain only the entities
that will be use to create DB tables with EF Code first)
Entities being reference in all the 3 layers
DAL being referenced in BAL and Web
BAL being referenced in Web
I want to get a link DAL
from a project Web
, my project Web
usually talks to BAL
all the time. The only reason I have to link to is DAL
because of the classes ASP.NET Identity
Startup.Auth.cs
and IdentityConfig.cs
. Each of the files contains one line of code that needs access to mine DBContext
, which is inside my project DAL
.
IdentityConfig.cs:
var manager = new ApplicationUserManager
(new UserStore<ApplicationUser>(context.Get<MyDbContext>()));
Startup.Auth.cs:
app.CreatePerOwinContext(MyDbContext.Create);
How can I set up something that I don't need to bind to the DAL inside the web project? You can offer
thank
source to share