So I'm following through some code snippets for AutoInjector and Automapper online, and noticed something that I don't really understand.
In the code, AutoInjector is Registering Automapper for use in this line.
container.Register(() => config.CreateMapper(container.GetInstance));
I noticed that container.GetInstance
isn't having anything passed into it.
After some tinkering, I tried to do var instance = container.GetInstance();
in a console app, but it gives the error The type arguments for method 'Container.GetInstance<TService>() cannot be inferred from the usage. Try specifying the type arguments explicitly.
Obviously, the arguments being passed are inferred from the outer method config.CreateMapper()
I was wondering if there was a way to step through the code so I can see what is being passed into container.GetInstance()
. When I step through the code, it just steps over the line and doesn't show me what's being passed into the method.