Beispiel #1
0
        public void Configure(BehaviorGraph graph)
        {
            var sagaHandlers = graph.Chains.SelectMany(x => x).OfType <HandlerCall>()
                               .Where(IsSagaHandler)
                               .ToArray();

            var settings = graph.Settings.Get <TransportSettings>();

            sagaHandlers.Each(call => {
                var types = ToSagaTypes(call);

                var sagaNode = new StatefulSagaNode(types)
                {
                    Repository = DetermineSagaRepositoryInstance(settings, types)
                };

                call.AddBefore(sagaNode);
            });
        }
        public void Configure(BehaviorGraph graph)
        {
            var sagaHandlers = graph.Chains.SelectMany(x => x).OfType<HandlerCall>()
                                    .Where(IsSagaHandler)
                                    .ToArray();

            var settings = graph.Settings.Get<TransportSettings>();

            sagaHandlers.Each(call => {
                var types = ToSagaTypes(call);

                var sagaNode = new StatefulSagaNode(types)
                {
                    Repository = DetermineSagaRepositoryInstance(settings, types)
                };

                call.AddBefore(sagaNode);
            });
        }