We're wondering what the best practise for registering types in a IoC-Container is.
What would be arguments for and against the following principles:
Principle 1: Only one Assembly my.project.DependencyInjection
- Seperate assembly for dependency injection
- One class (f.e.
UnityConfig.cs) where all types of the whole solution are registered
- my.project.DependencyInjection references alot of projects to register their types
Principle 2: A IoC container configuration class per executing assembly
- Every executing assembly has their own
- Only the needed types of this assembly are registered in the respective
What's your stance in this?
Thanks in advance for your opinions and arguments