Table of Contents

CorrelationIdentifierOptions Class

Definition

Configuration options for CorrelationIdentifierMiddleware.

public class CorrelationIdentifierOptions : IValidatableParameterObject, IParameterObject
Inheritance
CorrelationIdentifierOptions
Implements

Examples

The following example shows how to configure CorrelationIdentifierOptions with a custom correlation token. After validation, it prints the token's correlation ID.

using System;
using Cuemon.Messaging;

        namespace Cuemon.AspNetCore.Http.Headers;

        public static class CorrelationIdentifierOptionsExample
        {
            public static void Demonstrate()
            {
                var options = new CorrelationIdentifierOptions
        {
            Token = new CorrelationToken("corr-42")
        };

        options.ValidateOptions();
        Console.WriteLine(options.Token.CorrelationId);
            }
        }

Constructors

Name Description
CorrelationIdentifierOptions()

Initializes a new instance of the CorrelationIdentifierOptions class.

Properties

Name Description
HeaderName

Gets or sets the name of the correlation identifier HTTP header.

Token

Gets or sets the ICorrelationToken that provides a Correlation ID implementation.

Methods

Name Description
ValidateOptions()

Determines whether the public read-write properties of this instance are in a valid state.