Пример #1
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();
        }
Пример #2
0
 public static Task RegisterSaga <TSaga, TData>(this IMessagesRouter router, params Type[] startMessages)
     where TSaga : Saga <TData>, new()
     where TData : class, ISagaState
 {
     return(router.RegisterSaga(new TSaga().CreateDescriptor <TSaga, TData>(startMessages), typeof(TSaga).Name));
 }
 public async Task Register(IMessagesRouter router)
 {
     await router.RegisterSaga(SoftwareProgrammingSaga.Descriptor);
 }
Пример #4
0
 public async Task Register(IMessagesRouter router)
 {
     await router.RegisterSaga(SagaForRecycling.Descriptor);
 }
Пример #5
0
        public async Task Register(IMessagesRouter router)
        {
            await router.RegisterAggregate <TestAggregate, TestAggregateCommandHandler>();

            await router.RegisterSaga(TestSaga.SagaDescriptor);
        }