Monday, January 15, 2018

StructureMap: Using the IoC container inside the Registry

StructureMap has an easy to use Registry DSL that can be used in a Registry class. By using (one or more) Registry classes you can group all your IoC plumbing together.

Yesterday I had a situation where I wanted to use some object that was already registered in the IoC container in the registration of another class. This is possible by passing an IContext as a second parameter of the Use() method in the fluent API:

1 comment:

Vcom Infotech Company said...

Informative post within the coding for the registry, structuremap. Thanks a lot for the sharing. best infotech company in coimbatore | kovai e solutions