Exemplo n.º 1
0
        ISagaRegistrationConfigurator<T> IRegistrationConfigurator.AddSagaStateMachine<TStateMachine, T>(Type sagaDefinitionType)
        {
            ISagaRegistration Factory(IContainerRegistrar containerRegistrar)
            {
                SagaStateMachineRegistrationCache.Register(typeof(TStateMachine), containerRegistrar);

                if (sagaDefinitionType != null)
                    SagaDefinitionRegistrationCache.Register(sagaDefinitionType, containerRegistrar);

                return new SagaStateMachineRegistration<T>();
            }

            var registration = _sagaRegistrations.GetOrAdd(typeof(T), _ => Factory(_containerRegistrar));

            return new SagaRegistrationConfigurator<T>(this, registration, _containerRegistrar);
        }
        public ISagaRegistrationConfigurator <T> AddSagaStateMachine <TStateMachine, T>(Type sagaDefinitionType, Action <ISagaConfigurator <T> > configure = null)
            where TStateMachine : class, SagaStateMachine <T>
            where T : class, SagaStateMachineInstance
        {
            ISagaRegistration ValueFactory(Type type)
            {
                SagaStateMachineRegistrationCache.Register(typeof(TStateMachine), Registrar);

                return(new SagaStateMachineRegistration <T>());
            }

            var registration = _sagas.GetOrAdd(typeof(T), ValueFactory);

            registration.AddConfigureAction(configure);

            if (sagaDefinitionType != null)
            {
                SagaDefinitionRegistrationCache.Register(sagaDefinitionType, Registrar);
            }

            return(new SagaRegistrationConfigurator <T>(this, Registrar));
        }
 public void AddSagaStateMachine(Type sagaType, Type sagaDefinitionType)
 {
     SagaStateMachineRegistrationCache.AddSagaStateMachine(this, sagaType, sagaDefinitionType);
 }
 public void AddSagaStateMachine(Type sagaType, Type sagaDefinitionType)
 {
     SagaStateMachineRegistrationCache.AddSagaStateMachine(this, sagaType, _sagaRepositoryRegistrationProvider, sagaDefinitionType);
 }
Exemplo n.º 5
0
 void IRegistrationConfigurator.AddSagaStateMachine(Type sagaType, Type sagaDefinitionType)
 {
     SagaStateMachineRegistrationCache.AddSagaStateMachine(this, sagaType, sagaDefinitionType);
 }