public ConfigSimpleCqrs SubscribeForDomainEvents()
        {
            var typeCatalog = ServiceLocator.Resolve<ITypeCatalog>();
            var domainEventHandlerFactory = ServiceLocator.Resolve<IDomainEventHandlerFactory>();
            var domainEventTypes = typeCatalog.GetGenericInterfaceImplementations(typeof(IHandleDomainEvents<>));

            var eventBus = new NsbLocalEventBus(domainEventTypes, domainEventHandlerFactory);
            Configurer.RegisterSingleton<IEventBus>(eventBus);

            var configEventBus = new ConfigEventBus();
            configEventBus.Configure(this, runtime);

            return this;
        }
        public ConfigSimpleCqrs SubscribeForDomainEvents()
        {
            var typeCatalog = ServiceLocator.Resolve <ITypeCatalog>();
            var domainEventHandlerFactory = ServiceLocator.Resolve <IDomainEventHandlerFactory>();
            var domainEventTypes          = typeCatalog.GetGenericInterfaceImplementations(typeof(IHandleDomainEvents <>));

            var eventBus = new NsbLocalEventBus(domainEventTypes, domainEventHandlerFactory);

            Configurer.RegisterSingleton <IEventBus>(eventBus);

            var configEventBus = new ConfigEventBus();

            configEventBus.Configure(this, runtime);

            return(this);
        }