Registry equivalent in Unity

Is there an equivalent of the Registry class from StructureMap to Unity?

I like to think about a layer / component / library to customize it myself - thus filling the container. Thus, the "parent" level just needs to know about the registration class.

+5
source share
2 answers

No no. In our current project, we manually simulated the registry concept, although our implementation is not as strong as the StructureMap registry.

, , , (, IRegistry), IRegistry. Unity , Unity, IRegistry . , //.

public interface IRegistry 
{ 
    void Configure();
}

public class ServicesRegistry : IRegistry
{
    public ServicesRegistry(IUnityContainer container)
    {
        _container = container;
    }

    public sub Configure()
    {
        // Configure container for layer
    }
}

, , , , , .

+5

UnityConfiguration, API-, , Unity IoC, StructureMap

https://github.com/thedersen/UnityConfiguration

0

All Articles