コード例 #1
0
        void IRegistrationConfigurator.AddSaga(Type sagaType, Type sagaDefinitionType)
        {
            if (sagaType.HasInterface<SagaStateMachineInstance>())
                throw new ArgumentException($"State machine sagas must be registered using AddSagaStateMachine: {TypeMetadataCache.GetShortName(sagaType)}");

            _sagaRegistrations.GetOrAdd(sagaType, type => SagaRegistrationCache.CreateRegistration(type, sagaDefinitionType, _containerRegistrar));
        }
コード例 #2
0
        public void AddSaga(Type sagaType, Type sagaDefinitionType)
        {
            if (sagaType.HasInterface <SagaStateMachineInstance>())
            {
                throw new ArgumentException($"State machine sagas must be registered using AddSagaStateMachine: {TypeMetadataCache.GetShortName(sagaType)}");
            }

            _sagas.GetOrAdd(sagaType, type => SagaRegistrationCache.CreateRegistration(type, Registrar));

            if (sagaDefinitionType != null)
            {
                SagaDefinitionRegistrationCache.Register(sagaDefinitionType, Registrar);
            }
        }
コード例 #3
0
 void IRegistrationConfigurator.AddSaga(Type sagaType, Type sagaDefinitionType)
 {
     _sagaRegistrations.GetOrAdd(sagaType, type => SagaRegistrationCache.CreateRegistration(type, sagaDefinitionType, _containerRegistrar));
 }