Context
public class Context : IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable, IDictionary, ICollection, IReadOnlyDictionary<string, object>, IReadOnlyCollection<KeyValuePair<string, object>>
Context that carries with a single execution through a Policy. Commonly-used properties are directly on the class. Backed by a dictionary of string key / object value pairs, to which user-defined values may be added.
Do not re-use an instance of Context across more than one call through .Execute(...) or .ExecuteAsync(...).
A Guid guaranteed to be unique to each execution.
Acts as a correlation id so that events specific to a single execution can be identified in logging and telemetry.
A key unique to the call site of the current execution.
Policy instances are commonly reused across multiple call sites. Set an OperationKey so that logging and metrics can distinguish usages of policy instances at different call sites.The value is set by using the #ctor constructor taking an operationKey parameter.
The PolicyKey of the policy instance executing the current delegate.
When execution is through a PolicyWrap, identifies the PolicyWrap executing the current delegate by returning the PolicyKey of the outermost layer in the PolicyWrap; otherwise, null.
Initializes a new instance of the Context class, with the specified operationKey.
public Context()
Initializes a new instance of the Context class.
Initializes a new instance of the Context class, with the specified operationKey and the supplied contextData.