public class MyController
{
public MyController(): this(
container.Resolve<MyService>()
) {}
public MyController(MyService service)
{ ... }
}
When MyService is never registered, it rightly throws an UnableToResolveUnknownService exception.
However, MyService has a default constructor with empty parameters. Is there a way to get the DryIoc Container to use that when it finds no registrations for the concrete service class?
I have a controller:
When MyService is never registered, it rightly throws an UnableToResolveUnknownService exception.
However, MyService has a default constructor with empty parameters. Is there a way to get the DryIoc Container to use that when it finds no registrations for the concrete service class?