I'm new to the DI / IoC concept and would like to use Autofac in a three-layer ASP.NET Webforms application.
- User Interface Level: ASP.NET Web site.
- BLL: The business logic layer that invokes repositories on DAL.
- DAL: .EDMX file (Entity Model) and ObjectContext with repository classes that abstract CRUD operations for each object.
- Entities: POCO objects. Persistence Ignorant. Created by Microsoft ADO.Net POCO Entity Generator.
I asked a more general question here . Basically, I would like to create an obejctcontext for the HttpContext in my DAL. But I do not want to add a link to the DAL in the user interface or directly access the HttpContext in the DAL. I assume that IoC tools appear here. The answer to my previous question is a very good example of using Windsor Castle. I would like to use Autofac as my IoC tool and don't know how to achieve this. (How to access the DAL in application_start to register a component until I want to reference it in my user interface, what are the correct links to the possibility of using the DAL component in BLL with Autofac, Should I register BLL as a component with Autofac too)
Sorry that people do not ask an explicit question and do not ask some kind of working example. But I am very unfamiliar with the whole concept of IoC, and I do not think that I can achieve its use in my current time-limited project.
source share