Ejemplo n.º 1
0
        public static ConfigSimpleCqrs SimpleCqrs(this Configure configure, ISimpleCqrsRuntime runtime)
        {
            var configSimpleCqrs = new ConfigSimpleCqrs(runtime);

            configSimpleCqrs.Configure(configure);
            return(configSimpleCqrs);
        }
Ejemplo n.º 2
0
        public void Configure(ConfigSimpleCqrs config, ISimpleCqrsRuntime runtime)
        {
            Configurer = config.Configurer;
            Builder    = config.Builder;

            var serviceLocator = runtime.ServiceLocator;
            var typeCatalog    = serviceLocator.Resolve <ITypeCatalog>();

            var domainEventBusConfig    = GetConfigSection <DomainEventBusConfig>();
            var domainEventTypes        = typeCatalog.GetDerivedTypes(typeof(DomainEvent));
            var domainEventMessageTypes = new List <Type>();
            var bus = (UnicastBus)config
                      .MsmqTransport()
                      .UnicastBus()
                      .LoadMessageHandlers(new First <DomainEventMessageHandler>())
                      .CreateBus();

            RegisterAssemblyDomainEventSubscriptionMappings(domainEventBusConfig, domainEventTypes, domainEventMessageTypes, bus);
            RegisterDomainEventSubscriptionMappings(domainEventBusConfig, domainEventTypes, domainEventMessageTypes, bus);

            bus.Started += (s, e) => domainEventMessageTypes.ForEach(bus.Subscribe);
        }
Ejemplo n.º 3
0
        public void Configure(ConfigSimpleCqrs config, ISimpleCqrsRuntime runtime)
        {
            Configurer = config.Configurer;
            Builder = config.Builder;

            var serviceLocator = runtime.ServiceLocator;
            var typeCatalog = serviceLocator.Resolve<ITypeCatalog>();

            var domainEventBusConfig = GetConfigSection<DomainEventBusConfig>();
            var domainEventTypes = typeCatalog.GetDerivedTypes(typeof(DomainEvent));
            var domainEventMessageTypes = new List<Type>();
            var bus = (UnicastBus)config
                .MsmqTransport()
                .UnicastBus()
                    .LoadMessageHandlers(new First<DomainEventMessageHandler>())
                    .CreateBus();

            RegisterAssemblyDomainEventSubscriptionMappings(domainEventBusConfig, domainEventTypes, domainEventMessageTypes, bus);
            RegisterDomainEventSubscriptionMappings(domainEventBusConfig, domainEventTypes, domainEventMessageTypes, bus);

            bus.Started += (s, e) => domainEventMessageTypes.ForEach(bus.Subscribe);
        }
Ejemplo n.º 4
0
 public ConfigSimpleCqrs(ISimpleCqrsRuntime runtime)
 {
     this.runtime = runtime;
 }
Ejemplo n.º 5
0
 public DomainEventReplayer(ISimpleCqrsRuntime runtime)
 {
     this.runtime = runtime;
 }
Ejemplo n.º 6
0
 public ConfigCommandBus(ISimpleCqrsRuntime runtime) : base(runtime)
 {
     this.runtime = runtime;
 }
Ejemplo n.º 7
0
 public ConfigSimpleCqrs(ISimpleCqrsRuntime runtime)
 {
     this.runtime = runtime;
 }
Ejemplo n.º 8
0
 public ConfigCommandBus(ISimpleCqrsRuntime runtime)
     : base(runtime)
 {
     this.runtime = runtime;
 }
Ejemplo n.º 9
0
 public DomainEventReplayer(ISimpleCqrsRuntime runtime)
 {
     this.runtime = runtime;
 }
Ejemplo n.º 10
0
 public static ConfigSimpleCqrs SimpleCqrs(this Configure configure, ISimpleCqrsRuntime runtime)
 {
     var configSimpleCqrs = new ConfigSimpleCqrs(runtime);
     configSimpleCqrs.Configure(configure);
     return configSimpleCqrs;
 }
Ejemplo n.º 11
0
 public static ConfigSimpleCqrs SimpleCqrs(this Action<ServiceBusConfigurator> configure, ISimpleCqrsRuntime runtime)
 {
     var configSimpleCqrs = new ConfigSimpleCqrs(runtime);
     configSimpleCqrs.Configure(configure);
     return configSimpleCqrs;
 }