コード例 #1
0
        public void Configure(BehaviorGraph graph)
        {
            var sagaHandlers = graph.Behaviors.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 = DetermineSagaRepositoryDef(settings, types)
                };

                call.AddBefore(sagaNode);
            });
        }
コード例 #2
0
        public void Configure(BehaviorGraph graph)
        {
            var sagaHandlers = graph.Behaviors.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 = DetermineSagaRepositoryDef(settings, types)
                };

                call.AddBefore(sagaNode);
            });
        }