public override void CompensateActivityConfigured <TActivity, TLog>(ICompensateActivityConfigurator <TActivity, TLog> configurator)
        {
            var scopeProvider = new DependencyInjectionCompensateActivityScopeProvider <TActivity, TLog>(_serviceProvider);
            var scopeFilter   = new ScopeCompensateFilter <TActivity, TLog>(scopeProvider);
            var specification = new FilterPipeSpecification <CompensateContext <TLog> >(scopeFilter);

            configurator.Log(x => x.AddPipeSpecification(specification));
        }
Beispiel #2
0
        public static void CompensateActivityHost <TActivity, TLog>(this IReceiveEndpointConfigurator configurator, IServiceProvider provider,
                                                                    Action <ICompensateActivityConfigurator <TActivity, TLog> > configure = null)
            where TActivity : class, ICompensateActivity <TLog>
            where TLog : class
        {
            var compensateActivityScopeProvider = new DependencyInjectionCompensateActivityScopeProvider <TActivity, TLog>(provider);

            var factory = new ScopeCompensateActivityFactory <TActivity, TLog>(compensateActivityScopeProvider);

            configurator.CompensateActivityHost(factory, configure);
        }
        public static void CompensateActivityHost <TActivity, TLog>(this IReceiveEndpointConfigurator configurator, IServiceProvider serviceProvider,
                                                                    Action <ICompensateActivityConfigurator <TActivity, TLog> > configure = null)
            where TActivity : class, CompensateActivity <TLog>
            where TLog : class
        {
            var compensateActivityScopeProvider = new DependencyInjectionCompensateActivityScopeProvider <TActivity, TLog>(serviceProvider);

            var factory = new ScopeCompensateActivityFactory <TActivity, TLog>(compensateActivityScopeProvider);

            var specification = new CompensateActivityHostSpecification <TActivity, TLog>(factory);

            configure?.Invoke(specification);

            configurator.AddEndpointSpecification(specification);
        }