Exemplo n.º 1
0
        /// <summary>
        /// Gets the event bus.
        /// </summary>
        /// <param name="serviceLocator">The service locator.</param>
        /// <returns></returns>
        protected override IEventBus GetEventBus(IServiceLocator serviceLocator)
        {
            var typeCatalog = new AssemblyTypeCatalog(this.GetAssembliesToScan(serviceLocator));
            var domainEventHandlerFactory = new DomainEventHandlerFactory(serviceLocator);
            var domainEventTypes          = typeCatalog.GetGenericInterfaceImplementations(typeof(IHandleDomainEvents <>));

            return(new LocalEventBus(domainEventTypes, domainEventHandlerFactory));
        }
Exemplo n.º 2
0
        protected override ITypeCatalog GetTypeCatalog(IServiceLocator serviceLocator)
        {
            var assemblyTypeCatalog = new AssemblyTypeCatalog(new [] { typeof(TestingRuntime).Assembly });

            return(new TestingAssemblyTypeCatalog(assemblyTypeCatalog));
        }