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
correlationIdstringThe resolved correlation identifier, when available.
traceIdstringThe resolved trace identifier, when available.
metadataIReadOnlyDictionary<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
HasMetadata
Gets a value indicating whether safe request metadata is available.
public bool HasMetadata { get; }
Property Value
Metadata
Gets safe request metadata supplied by the ASP.NET Core adapter.
public IReadOnlyDictionary<string, string> Metadata { get; }
Property Value
TraceId
Gets the request trace identifier, when supplied by the host or current activity.
public string? TraceId { get; }
Property Value
Methods
MergeMetadata(IReadOnlyDictionary<string, string>?)
Merges safe request metadata with host-provided metadata.
public IReadOnlyDictionary<string, string> MergeMetadata(IReadOnlyDictionary<string, string>? metadata)
Parameters
metadataIReadOnlyDictionary<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
policyVersionstringOptional policy version.
policyHashstringOptional policy hash.
metadataIReadOnlyDictionary<string, string>Optional host-provided metadata to merge with safe request metadata.
Returns
- AsiBackboneConstraintEvaluationContext
A framework-neutral constraint evaluation context.