Open sandboxFocus

Class AspNetCoreRequestMetadata<T>

A base implementation of LogEventMetadata for ASP.NET Core incoming HTTP requests. You can derive from this class if you want to expose your own expression model. The default implementation is the non-generic AspNetCoreRequestMetadata, which exposes AspNetCoreRequestExpressionModel.

Inheritance
AspNetCoreRequestMetadata<T>
Namespace: PostSharp.Patterns.Diagnostics.Adapters.AspNetCore
Assembly: PostSharp.Patterns.Diagnostics.Adapters.AspNetCore.dll
Syntax
public abstract class AspNetCoreRequestMetadata<T> : LogEventMetadata<T>
Type Parameters
Name Description
T

The type of the expression model.

Constructors

Name Description
AspNetCoreRequestMetadata(string)

Initializes a new AspNetCoreRequestMetadata.

Methods

Name Description
HasInheritedProperty(HttpContext)

Determines if a given HttpContext defines inherited properties. The default implementation returns true if the request has a Correlation-Context header.

HasInheritedProperty(object)

Determines if the current LogEventMetadata contains any inherited property. The implementation of this method must not allocate heap memory.

VisitProperties<TVisitorState>(HttpContext, ILoggingPropertyVisitor<TVisitorState>, ref TVisitorState, in LoggingPropertyVisitorOptions)

Invokes the Visit<TValue>(string, TValue, in LoggingPropertyOptions, ref TState) method for all properties defined from a given HttpContext.

VisitProperties<TVisitorState>(object, ILoggingPropertyVisitor<TVisitorState>, ref TVisitorState, in LoggingPropertyVisitorOptions)

Invokes an action for each property in the raw CLR object of a LogEventData.

VisitProperty<TVisitorState, TValue>(string, TValue, ILoggingPropertyVisitor<TVisitorState>, ref TVisitorState, in LoggingPropertyOptions)

Called by VisitProperties<TVisitorState>(HttpContext, ILoggingPropertyVisitor<TVisitorState>, ref TVisitorState, in LoggingPropertyVisitorOptions) for each property. The default implementation filters out null or empty properties. You can override this method to change the default filtering.