public static CommandPipelineBuilder WithTransactionScopeSupressionBehavior(this CommandPipelineBuilder pipelineBuilder)
        {
            pipelineBuilder.WithBehavior(typeof(TransactionScopeSupressionBehavior <>));

            pipelineBuilder.Services.MoveServiceDescriptorBefore(typeof(TransactionScopeSupressionBehavior <>), typeof(OutboxProcessingBehavior <>));

            return(pipelineBuilder);
        }
Ejemplo n.º 2
0
        public static CommandPipelineBuilder WithUnitOfWorkBehavior <TContext>(this CommandPipelineBuilder pipelineBuilder)
            where TContext : DbContext
        {
            pipelineBuilder.Services.Replace <IUnitOfWork, UnitOfWork <TContext> >(ServiceLifetime.Scoped);
            pipelineBuilder.WithBehavior(typeof(UnitOfWorkBehavior <>));

            return(pipelineBuilder);
        }
Ejemplo n.º 3
0
        public static CommandPipelineBuilder WithInboxBehavior <TContext>(this CommandPipelineBuilder pipelineBuilder)
            where TContext : DbContext
        {
            pipelineBuilder.WithUnitOfWorkBehavior <TContext>();
            pipelineBuilder.Services.Replace <IBrokeredMessageInbox, BrokeredMessageInbox <TContext> >(ServiceLifetime.Scoped);
            pipelineBuilder.WithBehavior(typeof(InboxBehavior <>));

            return(pipelineBuilder);
        }
Ejemplo n.º 4
0
 public static CommandPipelineBuilder WithRoutingSlipBehavior(this CommandPipelineBuilder pipelineBuilder)
 {
     pipelineBuilder.WithBehavior(typeof(RoutingSlipBehavior <>));
     return(pipelineBuilder);
 }