コード例 #1
0
        public static InstanceSubscriptionConfigurator CompensateActivityHost <TActivity, TLog>(
            this SubscriptionBusServiceConfigurator configurator, Func <TLog, TActivity> controllerFactory)
            where TActivity : CompensateActivity <TLog>
            where TLog : class
        {
            var factory = new FactoryMethodCompensateActivityFactory <TActivity, TLog>(controllerFactory);
            var host    = new CompensateActivityHost <TActivity, TLog>(factory);

            return(configurator.Instance(host));
        }
コード例 #2
0
        public static void CompensateActivityHost <TActivity, TLog>(this IReceiveEndpointConfigurator configurator, Func <TLog, TActivity> controllerFactory,
                                                                    Action <ICompensateActivityConfigurator <TActivity, TLog> > configure = null)
            where TActivity : class, CompensateActivity <TLog>
            where TLog : class
        {
            var factory       = new FactoryMethodCompensateActivityFactory <TActivity, TLog>(controllerFactory);
            var specification = new CompensateActivityHostSpecification <TActivity, TLog>(factory);

            configure?.Invoke(specification);

            configurator.AddEndpointSpecification(specification);
        }
コード例 #3
0
        public static void CompensateActivityHost <TActivity, TLog>(this IReceiveEndpointConfigurator configurator, Func <TLog, TActivity> activityFactory,
                                                                    Action <ICompensateActivityConfigurator <TActivity, TLog> > configure = null)
            where TActivity : class, ICompensateActivity <TLog>
            where TLog : class
        {
            if (activityFactory == null)
            {
                throw new ArgumentNullException(nameof(activityFactory));
            }

            var factory = new FactoryMethodCompensateActivityFactory <TActivity, TLog>(activityFactory);

            CompensateActivityHost(configurator, factory, configure);
        }