Table of Contents

Class AsiBackboneHttpRequestCorrelation

Namespace
AsiBackbone.AspNetCore.Correlation
Assembly
AsiBackbone.AspNetCore.dll

Represents framework-neutral request correlation data resolved from the current ASP.NET Core HTTP request.

public sealed class AsiBackboneHttpRequestCorrelation
Inheritance
AsiBackboneHttpRequestCorrelation
Inherited Members
Extension Methods

Remarks

Initializes a new instance of the AsiBackboneHttpRequestCorrelation class.

Constructors

AsiBackboneHttpRequestCorrelation(string?, string?, IReadOnlyDictionary<string, string>?)

Represents framework-neutral request correlation data resolved from the current ASP.NET Core HTTP request.

public AsiBackboneHttpRequestCorrelation(string? correlationId = null, string? traceId = null, IReadOnlyDictionary<string, string>? metadata = null)

Parameters

correlationId string

The resolved correlation identifier, when available.

traceId string

The resolved trace identifier, when available.

metadata IReadOnlyDictionary<string, string>

Safe request metadata resolved from the host.

Remarks

Initializes a new instance of the AsiBackboneHttpRequestCorrelation class.

Properties

CorrelationId

Gets the request correlation identifier, when supplied by the host or propagated request headers.

public string? CorrelationId { get; }

Property Value

string

HasMetadata

Gets a value indicating whether safe request metadata is available.

public bool HasMetadata { get; }

Property Value

bool

Metadata

Gets safe request metadata supplied by the ASP.NET Core adapter.

public IReadOnlyDictionary<string, string> Metadata { get; }

Property Value

IReadOnlyDictionary<string, string>

TraceId

Gets the request trace identifier, when supplied by the host or current activity.

public string? TraceId { get; }

Property Value

string

Methods

MergeMetadata(IReadOnlyDictionary<string, string>?)

Merges safe request metadata with host-provided metadata.

public IReadOnlyDictionary<string, string> MergeMetadata(IReadOnlyDictionary<string, string>? metadata)

Parameters

metadata IReadOnlyDictionary<string, string>

Optional host-provided metadata.

Returns

IReadOnlyDictionary<string, string>

A normalized metadata dictionary.

ToEvaluationContext(string?, string?, IReadOnlyDictionary<string, string>?)

Creates a framework-neutral constraint evaluation context from the resolved request correlation data.

public AsiBackboneConstraintEvaluationContext ToEvaluationContext(string? policyVersion = null, string? policyHash = null, IReadOnlyDictionary<string, string>? metadata = null)

Parameters

policyVersion string

Optional policy version.

policyHash string

Optional policy hash.

metadata IReadOnlyDictionary<string, string>

Optional host-provided metadata to merge with safe request metadata.

Returns

AsiBackboneConstraintEvaluationContext

A framework-neutral constraint evaluation context.