Làm thế nào để làm điều đó trong mã được giải thích ở đây: Unity Register two interfaces as one singletonLàm thế nào tôi có thể đăng ký một singleton cho các giao diện khác nhau trong sự thống nhất, cấu hình XML?
_container.RegisterType<EventService>(new ContainerControlledLifetimeManager());
_container.RegisterType<IEventService, EventService>();
_container.RegisterType<IEventServiceInformation, EventService>();
bool singleton = ReferenceEquals(_container.Resolve<IEventService>(), _container.Resolve<IEventServiceInformation>());
Làm thế nào để làm điều đó trong cấu hình XML?
Và được cả hai trường hợp của Event_Class gonna được giống nhau không? – lukebuehler
Có. ReferenceEquals của bạn sẽ hoạt động. – ErnieL