/// <summary>
        /// Adds all sagas in the specified assemblies matching the namespace. If you are using both state machine and regular sagas, be
        /// sure to call AddSagaStateMachinesFromNamespaceContaining prior to calling this one.
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="type">The type to use to identify the assembly and namespace to scan</param>
        /// <param name="filter"></param>
        public static void AddSagaStateMachinesFromNamespaceContaining(this IContainerBuilderConfigurator configurator, Type type, Func <Type, bool> filter =
                                                                       null)
        {
            var registrar = new AutofacSagaStateMachineRegistrar(configurator.Builder);

            configurator.AddSagaStateMachinesFromNamespaceContaining(registrar, type, filter);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add the state machine sagas in the specified assembly to the service collection
        /// </summary>
        /// <param name="builder"></param>
        public static void RegisterSagaStateMachine <TStateMachine, TInstance>(this ContainerBuilder builder)
            where TStateMachine : class, SagaStateMachine <TInstance>
            where TInstance : class, SagaStateMachineInstance
        {
            var registrar = new AutofacSagaStateMachineRegistrar(builder);

            SagaStateMachineRegistrationCache.Register(typeof(TStateMachine), registrar);
        }
        /// <summary>
        /// Adds a SagaStateMachine to the registry, using the factory method, and updates the registrar prior to registering so that the default
        /// saga registrar isn't notified.
        /// </summary>
        /// <param name="configurator"></param>
        /// <typeparam name="TStateMachine"></typeparam>
        /// <typeparam name="TInstance"></typeparam>
        public static void AddSagaStateMachine <TStateMachine, TInstance>(this IContainerBuilderConfigurator configurator)
            where TStateMachine : class, SagaStateMachine <TInstance>
            where TInstance : class, SagaStateMachineInstance
        {
            var registrar = new AutofacSagaStateMachineRegistrar(configurator.Builder);

            configurator.AddSagaStateMachine <TStateMachine, TInstance>(registrar);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Add the state machine sagas by type
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="types">If specified, only the specified assemblies are scanned</param>
        public static void RegisterSagaStateMachines(this ContainerBuilder builder, params Type[] types)
        {
            var registrar = new AutofacSagaStateMachineRegistrar(builder);

            registrar.RegisterSagaStateMachines(types);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Add the state machine sagas in the specified assembly to the service collection
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="assemblies">If specified, only the specified assemblies are scanned</param>
        public static void RegisterSagaStateMachines(this ContainerBuilder builder, params Assembly[] assemblies)
        {
            var registrar = new AutofacSagaStateMachineRegistrar(builder);

            registrar.RegisterSagaStateMachines(assemblies);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Add the state machine sagas in the specified assembly to the service collection
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="type">The state machine saga type</param>
        public static void RegisterSagaStateMachine(this ContainerBuilder builder, Type type)
        {
            var registrar = new AutofacSagaStateMachineRegistrar(builder);

            SagaStateMachineRegistrationCache.Register(type, registrar);
        }
        /// <summary>
        /// Adds SagaStateMachines to the registry, using the factory method, and updates the registrar prior to registering so that the default
        /// saga registrar isn't notified.
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="types">The state machine types to add</param>
        public static void AddSagaStateMachines(this IContainerBuilderConfigurator configurator, params Type[] types)
        {
            var registrar = new AutofacSagaStateMachineRegistrar(configurator.Builder);

            configurator.AddSagaStateMachines(registrar, types);
        }
        /// <summary>
        /// Adds all sagas in the specified assemblies matching the namespace. If you are using both state machine and regular sagas, be
        /// sure to call AddSagaStateMachinesFromNamespaceContaining prior to calling this one.
        /// </summary>
        /// <param name="configurator"></param>
        /// <typeparam name="T">The anchor type</typeparam>
        public static void AddSagaStateMachinesFromNamespaceContaining <T>(this IContainerBuilderConfigurator configurator)
        {
            var registrar = new AutofacSagaStateMachineRegistrar(configurator.Builder);

            configurator.AddSagaStateMachinesFromNamespaceContaining(registrar, typeof(T));
        }