NServiceBus.Transport.MessageContext.MessageContext C# (CSharp) Method

MessageContext() public method

Initializes the context.
public MessageContext ( string messageId, string>.Dictionary headers, byte body, TransportTransaction transportTransaction, CancellationTokenSource receiveCancellationTokenSource, ContextBag context ) : System.Collections.Generic
messageId string Native message id.
headers string>.Dictionary The message headers.
body byte The message body.
transportTransaction TransportTransaction Transaction (along with connection if applicable) used to receive the message.
receiveCancellationTokenSource System.Threading.CancellationTokenSource /// Allows the pipeline to flag that it has been aborted and the receive operation should be rolled back. /// It also allows the transport to communicate to the pipeline to abort if possible. Transports should check if the token /// has been aborted after invoking the pipeline and roll back the message accordingly. ///
context ContextBag Any context that the transport wants to be available on the pipeline.
return System.Collections.Generic
        public MessageContext(string messageId, Dictionary<string, string> headers, byte[] body, TransportTransaction transportTransaction, CancellationTokenSource receiveCancellationTokenSource, ContextBag context)
        {
            Guard.AgainstNullAndEmpty(nameof(messageId), messageId);
            Guard.AgainstNull(nameof(body), body);
            Guard.AgainstNull(nameof(headers), headers);
            Guard.AgainstNull(nameof(transportTransaction), transportTransaction);
            Guard.AgainstNull(nameof(receiveCancellationTokenSource), receiveCancellationTokenSource);
            Guard.AgainstNull(nameof(context), context);

            Headers = headers;
            Body = body;
            MessageId = messageId;
            Context = context;
            TransportTransaction = transportTransaction;
            ReceiveCancellationTokenSource = receiveCancellationTokenSource;
        }
MessageContext