Exemple #1
0
        public Task Send(SendContext <T> context, IPipe <SendContext <T> > next)
        {
            if (_messageCorrelationId.TryGetCorrelationId(context.Message, out var correlationId))
            {
                context.CorrelationId = correlationId;
            }

            return(next.Send(context));
        }
        public MessageCorrelationIdEventCorrelationBuilder(SagaStateMachine <TInstance> machine, Event <TData> @event,
                                                           IMessageCorrelationId <TData> messageCorrelationId)
        {
            var configurator = new MassTransitEventCorrelationConfigurator <TInstance, TData>(machine, @event, null);

            configurator.CorrelateById(x => messageCorrelationId.TryGetCorrelationId(x.Message, out var correlationId)
                ? correlationId
                : throw new ArgumentException($"The message {TypeMetadataCache<TData>.ShortName} did not have a correlationId"));

            _configurator = configurator;
        }