Пример #1
0
        public Task Handle(StartCommandSaga message, IMessageHandlerContext context)
        {
            Data.CurrentIndex  = 0;
            Data.Originating   = message.Originating;
            Data.Commands      = message.Commands;
            Data.AbortCommands = message.AbortCommands;

            // Send first command
            return(SendNextCommand(context));
        }
Пример #2
0
        public Task Start()
        {
            var message = new StartCommandSaga
            {
                SagaId        = _sagaId,
                Originating   = _originating,
                Commands      = _commands.ToArray(),
                AbortCommands = _abortCommands.ToArray(),
            };


            var options = new SendOptions();

            options.SetDestination(_domainDestination);
            options.SetHeader(Defaults.RequestResponse, "0");
            options.SetHeader(Defaults.SagaHeader, message.SagaId);

            return(_context.Send(message, options));
        }