In a code I’m refactoring, I have the following situation:
void Plugin(IExternalService service)
{
var facade = new Facade(
new ExternalServiceWrapper(service),
new Dependency1(),
new Dependency2());
}
Where Dependency1 and Dependency2 are implementations of IDependency1 and IDependency2.
How can I convert this to a registration within Windsor installer? I can’t seem to figure our how to pass the instance of IExternalService to the container.
EDIT I’m not in control of the Plugin’s creation. I’d like to use it as a composition root to wire all the dependencies.
To register an existing instance, you can use the Instance method: