NServiceBus.HeaderOptionExtensions.SetHeader C# (CSharp) Method

SetHeader() public static method

Allows headers to be set for the outgoing message.
public static SetHeader ( this options, string key, string value ) : void
options this The options to extend.
key string The header key.
value string The header value.
return void
        public static void SetHeader(this ExtendableOptions options, string key, string value)
        {
            Guard.AgainstNull(nameof(options), options);
            Guard.AgainstNullAndEmpty(nameof(key), key);

            options.OutgoingHeaders[key] = value;
        }
HeaderOptionExtensions