PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​Adapters.​Diagnostic­SourceIDiagnostic­Source­Activity­FilterTry­Get­Correlation­Key
Open sandboxFocus

IDiagnosticSourceActivityFilter.TryGetCorrelationKey Method

TryGetCorrelationKey(Object, out Object)

Method called by DiagnosticSourceCollectingListener when a message suffixed .Start or .Stop is captured. The implementation must return the correlation object, i.e. a property of the message that is identical for both the start and the stop messages. This correlation key allows to pair the messages as a single activity. When the implementation returns null, no activity is created.

bool TryGetCorrelationKey(object message, out object correlationKey)
Type Name Description
Object message

The message value.

Object correlationKey

At output, the correlation key.

Type Description

true if the activity must be captured, false if it must be ignored.