Answer the question
In order to leave comments, you need to log in
How to use Unity IoC in N-Layer architecture application?
For a long time now I have been trying to master Unity IoC to use Dependency Injection in my applications. Every time the whole striving is shattered by the same problems. But more about this later and in order.
I am writing an ASP.NET MVC application. The N-Layer architecture was chosen for the application. Based on the architecture, there are 4 layers in the application (DAL, BLL, Web, DTO). Each layer depends on its neighbors and therefore inversion of control is used.
Previously, I used the Ninject package for DI, which allowed me to make properties like
[Inject]
public IMyInterface injectetProp {get; set;}
Answer the question
In order to leave comments, you need to log in
- Is it possible to put the DI configuration in web.config, and so that this configuration is the same for all layers of the application, or will it be necessary to duplicate the interface resolution settings in each layer?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question