I'm trying to use Simple Injector in a project which has the following architecture :
- DAL layer(owns a repositories),
- BLL layer(owns a services that talks to the repositories),
- MVC layer(talks to the services in the BLL layer).
when it comes to register with the container the classes and the interfaces, I`m facing a problem, Simple Injector needs me to register the repository with its interface (as my classes in the service layer accepts a repository in their constructor)
So, actually, Simple Injector forces me to add a references to my DAL layer in my MVC layer which i really like to avoid.
My question is, is it possible/right to make an external project that will hold only Simple Injector, and this project will have reference to all other projects and that way i would be able to register what i want and still keep my project abstraction?
or there is any other easy way to solve this ?