Is there a way to list all missing registrations at once, when Autofac tries to resolve constructor parameters through dependency resolver? Or is the only way to go through one at a time..
Take this as an example:
public MyWebApiController(IMyInterface myInterface)
I know that the class MyInterfaceImpl that implements IMyInterface has to be registered like this with Autofacs ContainerBuilder:
builder.RegisterType<MyInterfaceImpl>().As<IMyInterface>()
But what if MyInterfaceImpl depends on 10 other constructors, and each of them depends on a handfull.. Is there a way to let Autofac go through all dependencies that have not been registered with the ContainerBuilder, instead of throwing a DependencyResolutionException on the first occurence?
Take:
public MyInterfaceImpl(IMyInterface2 myInterface2, IMyInterface3 myInterface3, ... etc ...)
And each of these have their own constructors that need to be registered..
public MyInterface2Impl(IMyInterfaceB myInterfaceB)
etc.
Because I have missing Autofac registrations, the following exception message shows, telling me I have to register i.e. MyInterface2Impl with the interface.
None of the constructors found with 'Autofac.Core.Activators.Reflection.DefaultConstructorFinder' on type 'MyWebApiController' can be invoked with the available services and parameters
And details showing which parameter it rejects:
Cannot resolve parameter 'IMyInterface2 myInterface2' of constructor 'Void .ctor(IMyInterface2 myInterface2, IMyInterface3 myInterface3, ... etc ...)
But nothing about the next 5 missing registrations I possibly have. This is an annoyance, because I have to start up the site/service and call the api controller, after every missing registration I fix, and sometimes there can be a lot of missing registrations, when setting up the coctail.
So, can Autofac show me ALL the missing registrations at once?