I am a beginner to Unity DI Container.
I want to use it with a simple Console app.
I will use 'Code as Configuration'
Where should I call my method that Registers and Resolves my abstracts? From the Main method itself or there is a better, more elegant way?
Have a look at the concept of Composition Roots. For a console app the Main()
method is exactly the right place.
For Unity you can bundle your configuration in a class that derives from UnityContainerExtension and place the registration code inside the Initialize()
method.
Then add your extension to the container.