public static ConnectHandle ConnectStateMachineSaga <TInstance>(this IConsumePipeConnector pipe, IWindsorContainer container)
            where TInstance : class, SagaStateMachineInstance
        {
            ISagaStateMachineFactory stateMachineFactory = new WindsorSagaStateMachineFactory(container.Kernel);

            SagaStateMachine <TInstance> stateMachine = stateMachineFactory.CreateStateMachine <TInstance>();

            return(pipe.ConnectStateMachineSaga(stateMachine, container));
        }
        /// <summary>
        /// Subscribe a state machine saga to the endpoint
        /// </summary>
        /// <typeparam name="TInstance">The state machine instance type</typeparam>
        /// <param name="configurator"></param>
        /// <param name="container">The Windsor Lifetime Container to resolve the repository</param>
        /// <param name="configure">Optionally configure the saga</param>
        /// <returns></returns>
        public static void StateMachineSaga <TInstance>(this IReceiveEndpointConfigurator configurator, IWindsorContainer container,
                                                        Action <ISagaConfigurator <TInstance> > configure = null)
            where TInstance : class, SagaStateMachineInstance
        {
            ISagaStateMachineFactory stateMachineFactory = new WindsorSagaStateMachineFactory(container.Kernel);

            SagaStateMachine <TInstance> stateMachine = stateMachineFactory.CreateStateMachine <TInstance>();

            StateMachineSaga(configurator, stateMachine, container, configure);
        }