Context class for IMutateIncomingTransportMessages.
 public Task MutateIncoming(MutateIncomingTransportMessageContext context)
 {
     string bodyAsString = Encoding.UTF8
         .GetString(context.Body);
     log.Info("Serialized Message Body:");
     log.Info(bodyAsString);
     return Task.FromResult(0);
 }
 public Task MutateIncoming(MutateIncomingTransportMessageContext context)
 {
     string debugFlag = context.Headers.ContainsKey("Debug") ? context.Headers["Debug"] : "false";
     if (debugFlag != null && debugFlag.Equals("true", StringComparison.OrdinalIgnoreCase))
     {
         debug.Value = true;
     }
     else
     {
         debug.Value = false;
     }
     return Task.FromResult(0);
 }
 public Task MutateIncoming(MutateIncomingTransportMessageContext context)
 {
     if (!context.Headers.ContainsKey("IWasCompressed"))
     {
         return Task.FromResult(0);
     }
     using (GZipStream bigStream = new GZipStream(new MemoryStream(context.Body), CompressionMode.Decompress))
     {
         MemoryStream bigStreamOut = new MemoryStream();
         bigStream.CopyTo(bigStreamOut);
         context.Body = bigStreamOut.ToArray();
     }
     return Task.FromResult(0);
 }
        public Task MutateIncoming(MutateIncomingTransportMessageContext context)
        {
            // the bytes containing the incoming messages.
            byte[] bytes = context.Body;

            // optionally replace the Body
            context.Body = ServiceThatChangesBody.Mutate(context.Body);


            // the incoming headers
            IDictionary<string, string> headers = context.Headers;

            // optional manipulate headers

            // add a header
            headers.Add("MyHeaderKey1", "MyHeaderValue");

            // remove a header
            headers.Remove("MyHeaderKey2");

            return Task.FromResult(0);
        }
        public Task MutateIncoming(MutateIncomingTransportMessageContext context)
        {
            context.Body = context.Body.Reverse().ToArray();

            return Task.FromResult(false);
        }
 public async Task MutateIncoming(MutateIncomingTransportMessageContext context)
 {
     IDictionary<string, string> headers = context.Headers;
     var nsbVersion = headers[Headers.NServiceBusVersion];
     var customHeader = headers["MyCustomHeader"];
 }
 public Task MutateIncoming(MutateIncomingTransportMessageContext context)
 {
     context.Headers
         .Add("MutateIncomingTransportMessages", "ValueMutateIncomingTransportMessages");
     return Task.FromResult(0);
 }