moving from auto registration to explicit registrations

20 Views Asked by At

We currently have a bunch of auto registrations similar to:

container.Register(Classes.FromThisAssembly().Pick()
    .If(Component.IsInSameNamespaceAs<SecurityService>())
    .Configure(c => c.Named(c.Name))
    .WithService.DefaultInterfaces());

to perform auto registration of various types of services in our application.

This type of registration is quite brittle if moving classes between namespaces/assemblies so I'd like to find an approach to replace these auto registrations with explicit registrations.

Is there any way to iterate through all of the registrations and perhaps generate code to perform the same registration explicitly?

0

There are 0 best solutions below