Exemplo n.º 1
0
        public async Task Register(IMessagesRouter router)
        {
            await router.RegisterAggregate(new BalanceAggregatesCommandHandler());

            await router.RegisterSyncHandler <BalanceChangedEvent_V0, SampleProjectionBuilder>();

            await router.RegisterSyncHandler <BalanceChangedEvent_V1, SampleProjectionBuilder>();
        }
Exemplo n.º 2
0
        public async Task Register(IMessagesRouter router)
        {
            await router.RegisterAggregate(SampleAggregatesCommandHandler.Descriptor);

            await router.RegisterProjectionGroup(new SampleProjectionGroup(_locator));

            await router.RegisterHandler <SampleAggregateChangedEvent, SampleProjectionBuilder>(m => m.SourceId);
        }
Exemplo n.º 3
0
        public async Task Register(IMessagesRouter router)
        {
            await router.RegisterAggregate(new AccountCommandsHandler());

            await router.RegisterAggregate(new OrderCommandsHandler(null));

            await router.RegisterAggregate(new SkuCommandsHandler(null));

            await router.RegisterAggregate(new SkuStockCommandsHandler());

            await router.RegisterAggregate(new UserCommandsHandler());

            await router.RegisterProcess(new BuyNow(null));

            await router.RegisterSyncHandler <AccountCreated, AccountProjectionBuilder>();

            await router.RegisterSyncHandler <AccountReplenish, AccountProjectionBuilder>();

            await router.RegisterSyncHandler <AccountWithdrawal, AccountProjectionBuilder>();

            await router.RegisterSyncHandler <OrderCreated, OrdersProjectionBuilder>();

            await router.RegisterSyncHandler <ItemAdded, OrdersProjectionBuilder>();

            await router.RegisterSyncHandler <OrderCompleted, OrdersProjectionBuilder>();

            await router.RegisterSyncHandler <SkuCreated, SkuProjectionBuilder>();

            await router.RegisterSyncHandler <SkuStockCreated, SkuStockProjectionBuilder>();

            await router.RegisterSyncHandler <StockAdded, SkuStockProjectionBuilder>();

            await router.RegisterSyncHandler <StockReserved, SkuStockProjectionBuilder>();

            await router.RegisterSyncHandler <ReserveExpired, SkuStockProjectionBuilder>();

            await router.RegisterSyncHandler <StockTaken, SkuStockProjectionBuilder>();

            await router.RegisterSyncHandler <StockReserveTaken, SkuStockProjectionBuilder>();

            await router.RegisterSyncHandler <ReserveRenewed, SkuStockProjectionBuilder>();

            await router.RegisterSyncHandler <ReserveCanceled, SkuStockProjectionBuilder>();
        }
Exemplo n.º 4
0
        public void Register(IMessagesRouter router)
        {
            router.RegisterAggregate <Account, AccountAggregateCommandsHandler>();
            router.RegisterAggregate <Bill, BillAggregateCommandsHandler>();
            router.RegisterAggregate <Subscription, SubscriptionAggregateCommandsHandler>();
            router.RegisterAggregate <Business, BusinessAggregateCommandsHandler>();

            router.RegisterSaga(BuySubscriptionSaga.Descriptor);

            router.Route <AccountBalanceReplenishEvent>()
            .ToHandler <BusinessCurrentBalanceProjectionBuilder>()
            .WithCorrelation(nameof(AccountBalanceReplenishEvent.BalanceId))
            .Register();

            router.Route <AccountCreatedEvent>()
            .ToHandler <BusinessCurrentBalanceProjectionBuilder>()
            .WithCorrelation(nameof(AccountCreatedEvent.BalanceId))
            .Register();

            router.Route <PayedForBillEvent>()
            .ToHandler <BusinessCurrentBalanceProjectionBuilder>()
            .WithCorrelation(nameof(PayedForBillEvent.BalanceId))
            .Register();

            router.Route <AccountBalanceReplenishEvent>()
            .ToHandler <TransactionsProjectionBuilder>()
            .WithCorrelation(nameof(AccountBalanceReplenishEvent.BalanceId))
            .Register();

            router.Route <AccountCreatedEvent>()
            .ToHandler <TransactionsProjectionBuilder>()
            .WithCorrelation(nameof(AccountCreatedEvent.BalanceId))
            .Register();

            router.Route <PayedForBillEvent>()
            .ToHandler <TransactionsProjectionBuilder>()
            .WithCorrelation(nameof(PayedForBillEvent.BalanceId))
            .Register();
        }
Exemplo n.º 5
0
 public async Task Register(IMessagesRouter router)
 {
     await router.RegisterAggregate(TestAggregatesCommandHandler.Descriptor);
 }
Exemplo n.º 6
0
        public async Task Register(IMessagesRouter router)
        {
            await router.RegisterAggregate(BalanceAggregatesCommandHandler.Descriptor);

            await router.RegisterHandler <BalanceChangedEvent_V0, SampleProjectionBuilder>(m => m.SourceId);
        }
Exemplo n.º 7
0
        public async Task Register(IMessagesRouter router)
        {
            await router.RegisterAggregate <TestAggregate, TestAggregateCommandHandler>();

            await router.RegisterSaga(TestSaga.SagaDescriptor);
        }