Table of Contents

RequestIdentifierOptions Class

Definition

Configuration options for RequestIdentifierMiddleware.

public class RequestIdentifierOptions : IValidatableParameterObject, IParameterObject
Inheritance
RequestIdentifierOptions
Implements

Examples

The following example demonstrates how to configure to customize the Request-ID header name and token.

// Program.cs
using System;
using Cuemon.AspNetCore.Http.Headers;
using Cuemon.Messaging;

var options = new RequestIdentifierOptions
{
    HeaderName = "X-Custom-Request-ID",
    Token = new RequestToken("req-42")
};

options.ValidateOptions();
Console.WriteLine($"{options.HeaderName}: {options.Token.RequestId}");

Constructors

Name Description
RequestIdentifierOptions()

Initializes a new instance of the RequestIdentifierOptions class.

Properties

Name Description
HeaderName

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

Token

Gets or sets the IRequestToken that provides a Request ID implementation.

Methods

Name Description
ValidateOptions()

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