PostSharp 2023.0 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Diagnostics.​Adapters.​Diagnostic­Source Namespace / IDiagnostic­Source­Activity­Filter Interface / IDiagnostic­Source­Activity­Filter Methods / IDiagnostic­Source­Activity­Filter.​Try­Get­Correlation­Key Method

IDiagnosticSourceActivityFilter.TryGetCorrelationKey Method

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.

Namespace:  PostSharp.Patterns.Diagnostics.Adapters.DiagnosticSource
Assembly:  PostSharp.Patterns.Diagnostics.Adapters.DiagnosticSource (in PostSharp.Patterns.Diagnostics.Adapters.DiagnosticSource.dll) Version: 2023.0.3.0 (2023.0.3.0)
bool TryGetCorrelationKey(
	Object message,
	out Object correlationKey


Type: System.Object
The message value.
Type: System.Object
At output, the correlation key.

Return Value

Type: Boolean
true if the activity must be captured, false if it must be ignored.
See Also