public async Task Register(IDomainBuilder builder)
        {
            await builder.RegisterAggregate(new AggregateConfiguration <Calculator>(null, new AggregateSettings(hostRole: "calculation")));

            builder.RegisterCommandsResultAdapter <Calculator>(new CalculatorCommandResultAdapter());
            builder.RegisterCommandHandler(handler => new CalculatorCommandsHandler(handler));
        }
 public void Register(IDomainBuilder builder)
 {
     builder.RegisterAggregate(new BalloonDependencyFactory());
     builder.RegisterHandler <BalloonCreated, CountingMessageHandler>().AsSync();
     builder.RegisterHandler <BalloonCreated, SlowCountingMessageHandler>(c => new SlowCountingMessageHandler(c.Publisher)).AsFireAndForget();
     builder.RegisterHandler <BalloonTitleChanged, CountingMessageHandler>().AsSync();
 }
 public static void Register(this IDomainBuilder builder, params IDomainConfiguration[] maps)
 {
     foreach (var m in maps)
     {
         m.Register(builder);
     }
 }
            public void Register(IDomainBuilder builder)
            {
                var dep     = new Dependency(10);
                var factory = DefaultAggregateDependencyFactory.ForCommandAggregate <AggregateWithDependency>(new CustomAggregateFactory(dep));

                builder.RegisterAggregate(factory);
            }
Beispiel #5
0
 public void Register(IDomainBuilder container)
 {
     foreach (var reg in _registrations)
     {
         reg.Invoke(container);
     }
 }
Beispiel #6
0
        public void Register(IDomainBuilder builder)
        {
            var handler = new FutureEventsSchedulingMessageHandler(_schedulingActor, _logger);

            builder.RegisterHandler <FutureEventScheduledEvent, FutureEventsSchedulingMessageHandler>(c => handler).AsSync();
            builder.RegisterHandler <FutureEventCanceledEvent, FutureEventsSchedulingMessageHandler>(c => handler).AsSync();
        }
Beispiel #7
0
        public static IDomainBuilder AddRing(this IDomainBuilder builder, IConfiguration configuration)
        {
            builder.Services.AddMemoryCache();

            builder.AddDomainCore();
            builder.AddRingOptions(configuration);

            builder.Services.TryAdd(new ServiceCollection()
                                    .AddSingleton <ICommandBus, RingCommandBus>()
                                    .AddSingleton <IEventBus, RingEventBus>()
                                    .AddSingleton <IContextCache, RingContextMemoryCache>()
                                    .AddSingleton <ISnapshootCache, SnapshootMemoryCache>()
                                    .AddSingleton <IEventHandleSubject, EventHandleSubject>()
                                    .AddSingleton <IRingBufferProcess, RingBufferProcess>()
                                    );

            builder.Services.Add(new ServiceCollection()
                                 .AddTransient <IHostedService, RingBufferServerHostedService>()
                                 );

            //IEventBus


            return(builder);
        }
Beispiel #8
0
        public static IDomainBuilder AddDomainService(this IDomainBuilder builder)
        {
            var domainServiceBuilder = new DomainServiceBuilder(builder.Services);

            domainServiceBuilder.Build();
            return(builder);
        }
Beispiel #9
0
        public void Register(IDomainBuilder builder)
        {
            var provider         = new BitCoinUsdPriceProvider();
            var aggregateFactory = DefaultAggregateDependencyFactory.ForCommandAggregate <BinaryOptionGame>();

            aggregateFactory.AggregateFactoryCreator = () => new BinaryOptionsAggregateConstructor(provider);
            builder.RegisterAggregate <BinaryOptionGame>();
        }
        public void Register(IDomainBuilder builder)
        {
            var commandHandler             = new TestAggregatesCommandHandler(new TestDependencyImplementation());
            var aggregateDependencyFactory = DefaultAggregateDependencyFactory.New(commandHandler);

            aggregateDependencyFactory.AggregateFactoryCreator = () => new TestAggregateFactory(new TestDependencyImplementation());
            aggregateDependencyFactory.SnapshotsFactoryCreator = () => new TestAggregateFactory(new TestDependencyImplementation());
            builder.RegisterAggregate(aggregateDependencyFactory);
        }
 public RegisterSurfaceController(
     IAccountService accountService,
     IViewModelBuilder<TrocaBolasUser, RegisterViewModel> viewModelBuilder,
     IDomainBuilder<RegisterViewModel, TrocaBolasUser> domainBuilder)
 {
     _accountService = accountService;
     _domainBuilder = domainBuilder;
     _viewModelBuilder = viewModelBuilder;
 }
Beispiel #12
0
        public static IDomainBuilder AddMixedMapping(this IDomainBuilder builder)
        {
            var mappingBuilder = new MixedCommandMappingProviderBuilder();

            mappingBuilder.AddAutoMapping();
            builder.Services.TryAddSingleton <ICommandMappingProvider>(mappingBuilder.Build);

            return(builder);
        }
Beispiel #13
0
        public void Register(IDomainBuilder builder)
        {
            builder.Register(_container.Resolve <BuyNowProcessDomainConfiguration>());
            builder.Register(_container.Resolve <SkuDomainConfiguration>());
            builder.Register(_container.Resolve <OrderDomainConfiguration>());
            builder.Register(_container.Resolve <UserDomainConfiguration>());

            builder.Register(new SkuStockDomainConfiguration());
            builder.Register(new AccountDomainConfiguration());
        }
Beispiel #14
0
        internal static IDomainBuilder AddRingOptions(this IDomainBuilder builder, IConfiguration configuration)
        {
            builder.Services.TryAdd(new ServiceCollection()
                                    .AddSingleton <IConfigureOptions <RingOptions> >(new RingConfigureOptions(configuration))
                                    .AddSingleton <IOptionsChangeTokenSource <RingOptions> >(new ConfigurationChangeTokenSource <RingOptions>(configuration))

                                    );

            return(builder);
        }
        public void Register(IDomainBuilder builder)
        {
            builder.RegisterAggregate(new BalloonDependencyFactory());

            BalloonContext BalloonContextProducer() => new BalloonContext(_dbContextOptions);

            builder.RegisterHandler <BalloonTitleChanged, BalloonCatalogProjection>(c => new BalloonCatalogProjection(BalloonContextProducer, c.Publisher, c.Log))
            .AsSync();

            builder.RegisterHandler <BalloonCreated, BalloonCatalogProjection>(c => new BalloonCatalogProjection(BalloonContextProducer, c.Publisher, c.Log))
            .AsSync();
        }
        public void Register(IDomainBuilder builder)
        {
            builder.RegisterAggregate(new BalloonDependencyFactory());

            builder.RegisterHandler <BalloonCreated, BalloonCreatedFaultyProjection>
                (c => new BalloonCreatedFaultyProjection()).AsSync();

            builder.RegisterHandler <BalloonTitleChanged, BalloonTitleChangedFaultyMessageHandler>
                (c => new BalloonTitleChangedFaultyMessageHandler(c.Publisher)).AsSync();

            builder.RegisterHandler <BalloonTitleChanged, BalloonTitleChangedOddFaultyMessageHandler>
                (c => new BalloonTitleChangedOddFaultyMessageHandler(c.Publisher)).AsSync();
        }
        public static IDomainBuilder AddMongo(this IDomainBuilder builder, IConfiguration configuration)
        {
            builder.AddMongoOptions(configuration);

            builder.Services.TryAdd(new ServiceCollection()
                                    .AddSingleton <IEventStore, MongoEventStore>()
                                    .AddSingleton <ISubscribeEventStore, MongoSubscribeEventStore>()
                                    .AddSingleton <ISnapshootQueryFactory, MongoSnapshootQueryFactory>()
                                    .AddSingleton <ISnapshootStoreFactory, MongoSnapshootStoreFactory>()
                                    .AddSingleton <IDatabaseInitializer, MongoDatabaseInitializer>()
                                    );


            return(builder);
        }
Beispiel #18
0
        public static IDomainBuilder AddDomainCore(this IDomainBuilder builder)
        {
            builder.Services.AddLogging();

            builder.Services.TryAdd(new ServiceCollection()
                                    .AddSingleton <IAssemblyProvider, AssemblyProvider>()
                                    .AddSingleton <IEventRebuildHandler, EventRebuildHandler>()
                                    .AddSingleton <ICommandRegister, AutoCommandRegister>()
                                    .AddSingleton <ICommandHandlerFactory, CommandHandlerFactory>()
                                    .AddSingleton <IEventRegister, AutoEventRegister>()
                                    .AddSingleton <IEventHandlerFactory, EventHandlerFactory>()
                                    .AddSingleton <IAggregateRootRebuilder, AggregateRootRebuilder>()
                                    .AddSingleton <IEventRebuildInitializer, EventRebuildInitializer>()
                                    .AddSingleton <IAggregateRootValidator, AggregateRootValidator>()
                                    );

            return(builder);
        }
        public void Register(IDomainBuilder builder)
        {
            var factory = new DefaultAggregateDependencyFactory <TestFutureEventsAggregate>(() => new FutureEventsAggregatesCommandHandler());

            builder.RegisterAggregate(factory);
        }
 public void Register(IDomainBuilder builder)
 {
     builder.RegisterAggregate(new BalloonDependencyFactory());
 }
Beispiel #21
0
 public void Register(IDomainBuilder builder)
 {
     builder.RegisterAggregate <ProgrammerAggregate>();
     builder.RegisterAggregate <CoffeMachineAggregate>();
 }
Beispiel #22
0
 public static void SetEfContextType <TDbContext>(this IDomainBuilder builder)
 {
     _contextType = typeof(TDbContext);
 }
Beispiel #23
0
 public async Task Register(IDomainBuilder builder)
 {
     await builder.RegisterAggregate(new AggregateDependencies <Cat>());
 }
 public HandlerRegistrator(Func <IMessageProcessContext, THandler> producer, IDomainBuilder builder)
 {
     _producer = producer;
     _builder  = builder;
 }
Beispiel #25
0
 public static IDomainBuilder AddMapping <TMapping>(this IDomainBuilder builder) where TMapping : class, ICommandMappingProvider
 {
     builder.Services.TryAddSingleton <ICommandMappingProvider, TMapping>();
     return(builder);
 }
Beispiel #26
0
 public void Register(IDomainBuilder builder)
 {
     builder.RegisterAggregate(DefaultAggregateDependencyFactory);
     builder.RegisterHandler <BalanceChangedEvent_V0, SampleProjectionBuilder>(c => new SampleProjectionBuilder(c.Publisher)).AsSync();
     builder.RegisterHandler <BalanceChangedEvent_V1, SampleProjectionBuilder>(c => new SampleProjectionBuilder(c.Publisher)).AsSync();
 }
Beispiel #27
0
 public void Register(IDomainBuilder builder)
 {
     builder.RegisterAggregate(DefaultAggregateDependencyFactory.New(new SkuCommandsHandler(_sequenceProvider)));
 }
Beispiel #28
0
 public void Register(IDomainBuilder builder)
 {
     builder.RegisterAggregate(DefaultAggregateDependencyFactory.New(new TestAggregateCommandHandler()));
 }
 public void Register(IDomainBuilder builder)
 {
     builder.RegisterProcessManager(new DefaultProcessDependencyFactory <BuyNowState>(new BuyNow(null), () => new BuyNow(_calculator),
                                                                                      () => new BuyNowProcessStateFactory()));
 }
 public RegisterSurfaceController()
 {
     _accountService = new AccountService();
     _domainBuilder = new TrocaBolasUserDomainBuilder(_accountService);
     _viewModelBuilder = new RegisterViewModelBuilder(_accountService);
 }
 public void Register(IDomainBuilder builder)
 {
     builder.RegisterAggregate(BalloonDependencyFactory);
     builder.RegisterHandler <BalloonCreated, BalloonCreatedNotificator> (c => new BalloonCreatedNotificator(c.Publisher)).AsSync();
     builder.RegisterHandler <BalloonTitleChanged, BalloonTitleChangedNotificator>(c => new BalloonTitleChangedNotificator(c.Publisher)).AsSync();
 }
Beispiel #32
0
 public void Register(IDomainBuilder builder)
 {
     builder.RegisterAggregate(DefaultAggregateDependencyFactory.New <Account, AccountCommandsHandler>());
 }