DotNetStarter - Locators

A locator package must be installed to enable the ILocator and use DotNetStarter. The ILocator and ILocatorRegistry system is a wrapper for any container that can implement the interfaces. The following are the currently supported container implementations:

To select a locator the application developer by overriding the default as noted below:

DotNetStarter.Configure.StartupBuilder.Create()
    .ConfigureAssemblies(a => a.WithDiscoverableAssemblies())
    .OverrideDefaults(d => d.UseLocatorRegistryFactory(new DotNetStarter.Locators.DryIocLocatorFactory())) //uses DryIoc
    .Build()
    .Run();

If the default isn’t overridden a locator is discovered at runtime in the configured assemblies by an assembly attribute as noted below for DryIoc.

[assembly: DotNetStarter.Abstractions.LocatorRegistryFactory(typeof(DotNetStarter.DryIocLocatorFactory))]

Custom Locator

A custom locator may also be provided so long as it implements the following interfaces

The custom ILocatorRegistry may then be passed to the override defaults during the StartupBuilder process.

Optional features

Features can be added to ILocator and ILocatorRegistry implementations with addtional interfaces as noted below:

Package authors should avoid using the optional features in packages, as they are intended for application developers.