Come fare in codice è spiegato qui: Unity Register two interfaces as one singletonCome posso registrare un singleton su diverse interfacce in unità, XML config?
_container.RegisterType<EventService>(new ContainerControlledLifetimeManager());
_container.RegisterType<IEventService, EventService>();
_container.RegisterType<IEventServiceInformation, EventService>();
bool singleton = ReferenceEquals(_container.Resolve<IEventService>(), _container.Resolve<IEventServiceInformation>());
Come fare nella configurazione XML?
e sono entrambe le istanze di event_class andando essere lo stesso? – lukebuehler
Sì. I tuoi ReferenceEquals dovrebbero funzionare. – ErnieL