CorrelationIdScope
- Namespace:
PPDS.Dataverse.Diagnostics - Assembly:
PPDS.Dataverse - Kind: Class
Summary
Ambient correlation-ID scope shared by the CLI, the RPC daemon, and every Dataverse service called from either surface.
Members
Methods
NewId
string NewId()
Generates a new GUID-based correlation id (lowercase hyphenated form).
Callers should prefer PPDS.Dataverse.Diagnostics.CorrelationIdScope.Push(System.String) to install a value;
this helper exists so CLI entrypoints can seed the initial id without
duplicating the format string.
Push
IDisposable Push(string correlationId)
Establishes a correlation-id scope for the lifetime of the returned
System.IDisposable. The previous value is restored on dispose so
nested scopes (e.g., CLI entry → per-RPC-call) behave correctly.
-
Param
correlationId: The correlation id to install. Anullor whitespace value is treated as "clear the slot" for this scope. -
Returns: A disposable handle that restores the previous value.
Properties
Current
string Current { get; }
Gets the correlation id for the current async flow, or null
when no scope is active.