PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​ContextsAsync­Logging­ContextGet­Execution­Context­Data
Open sandboxFocus

AsyncLoggingContext.GetExecutionContextData Method

GetExecutionContextData(LoggingExecutionContextData, Boolean)

Returns a new layer for the async stack that has this LoggingContext as the associated activity and current as the PostSharp.Patterns.Diagnostics.Contexts.LoggingExecutionContextData.Parent, if a new layer is required.

Declaration
protected override LoggingExecutionContextData GetExecutionContextData(LoggingExecutionContextData current, bool requireNew)
Parameters
Type Name Description
LoggingExecutionContextData current

The layer in the async stack that's currently on top. It will become the parent of the new layer.

Boolean requireNew

If true, then this method must return a new instance. This is a parameter passed by the overriding method to the base call if the overriding method wants the layer to be created even if there's no properties or synthetic ID.

Returns
Type Description
LoggingExecutionContextData

The LoggingExecutionContextData to be put on top of the async stack, or null if the no new layer is needed.

Overrides
LoggingContext.GetExecutionContextData(LoggingExecutionContextData, Boolean)