예제 #1
0
        public void Configure <T>()
            where T : class, ISaga
        {
            var sagaRepository = _scope.Resolve <ISagaRepository <T> >();

            var autofacSagaRepository = new AutofacSagaRepository <T>(sagaRepository, _scope, _name);

            _configurator.Saga(autofacSagaRepository);
        }
예제 #2
0
        /// <summary>
        /// Registers a saga using the container that has the repository resolved from the container
        /// </summary>
        /// <typeparam name="TSaga"></typeparam>
        /// <param name="configurator"></param>
        /// <param name="scope"></param>
        /// <returns></returns>
        public static ISagaSubscriptionConfigurator <TSaga> Saga <TSaga>(
            this ISubscriptionBusServiceConfigurator configurator, ILifetimeScope scope, string name = "message")
            where TSaga : class, ISaga
        {
            var sagaRepository = scope.Resolve <ISagaRepository <TSaga> >();

            var autofacSagaRepository = new AutofacSagaRepository <TSaga>(sagaRepository, scope, name);

            return(configurator.Saga(autofacSagaRepository));
        }