INNER CODE UNIT · C#
CorrelationContext
stevejgordon/CorrelationId · src/CorrelationId/CorrelationContext.cs:9
public class CorrelationContext
{
/// <summary>
/// The default correlation ID is used in cases where the correlation has not been set by the <see cref="ICorrelationIdProvider"/>.
/// </summary>
public const string DefaultCorrelationId = "Not set";
/// <summary>
/// Create a <see cref="CorrelationContext"/> instance.
/// </summary>
/// <param name="correlationId">The correlation ID on the context.</param>
/// <param name="header">The name of the header from which the Correlation ID was read/written.</param>
/// <exception cref="ArgumentException">Thrown if the <paramref name="header"/> is null or empty.</exception>
public CorrelationContext(string correlationId, string header)
{
correlationId ??= DefaultCorrelationId;
if (string.IsNullOrEmpty(header))