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
UnityConfig.cs
file - Only the needed types of this assembly are registered in the respective
UnityConfig.cs
file
What's your stance in this?
Thanks in advance for your opinions and arguments