How to use single component for multiple services in Unity Framework?
In Windsor it is configured in the following way:
var container = new WindsorContainer();
container.Register(Component.For<Service1, Service2>()
.ImplementedBy<Component>());
var service1 = container.Resolve<Service1>();
var service2 = container.Resolve<Service2>();
The idea with forwarded types is that if the component is a singleton service1
and service2
are the same instance.