public async Task Send(SendContext <T> context) { context.Serializer = _endpoint.Serializer; context.DestinationAddress = _endpoint.DestinationAddress; if (context.SourceAddress == null) { context.SourceAddress = _endpoint.SourceAddress; } if (_pipe != null) { await _pipe.Send(context).ConfigureAwait(false); } if (_sendPipe != null) { await _sendPipe.Send(context).ConfigureAwait(false); } if (!context.CorrelationId.HasValue) { MessageCorrelationCache <T> .SetCorrelationId(context); } if (!context.ConversationId.HasValue) { context.ConversationId = NewId.NextGuid(); } }
public static void UseCorrelationId <T>(Func <T, Guid> getCorrelationId) where T : class { MessageCorrelationCache <T> .UseCorrelationId(getCorrelationId); }