NServiceBus.AuditContext.AddAuditData C# (CSharp) Method

AddAuditData() public method

Adds information about the current message that should be audited.
public AddAuditData ( string key, string value ) : void
key string The audit key.
value string The value.
return void
        public void AddAuditData(string key, string value)
        {
            Guard.AgainstNullAndEmpty(nameof(key), key);
            Guard.AgainstNullAndEmpty(nameof(value), value);

            AuditToDispatchConnector.State state;

            if (!Extensions.TryGet(out state))
            {
                state = new AuditToDispatchConnector.State();
                Extensions.Set(state);
            }
            state.AuditValues[key] = value;
        }
    }