Class Context
- Namespace
- Polly
- Assembly
- Polly.dll
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.
public class Context : Dictionary<string, object>, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IDictionary, ICollection, IReadOnlyDictionary<string, object>, IReadOnlyCollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable, ISerializable, IDeserializationCallback
- Inheritance
-
Context
- Implements
- Inherited Members
Constructors
Context(string)
Initializes a new instance of the Context class, with the specified executionKey
.
public Context(string executionKey)
Parameters
executionKey
stringThe execution key.
Context(string, IDictionary<string, object>)
Initializes a new instance of the Context class, with the specified executionKey
and the supplied contextData
.
public Context(string executionKey, IDictionary<string, object> contextData)
Parameters
executionKey
stringThe execution key.
contextData
IDictionary<string, object>The context data.
Properties
ExecutionGuid
A Guid guaranteed to be unique to each execution.
public Guid ExecutionGuid { get; }
Property Value
ExecutionKey
A key unique to the call site of the current execution.
public string ExecutionKey { get; }
Property Value
PolicyKey
A key unique to the Policy instance executing the current delegate.
public string PolicyKey { get; }
Property Value
PolicyWrapKey
A key unique to the outermost PolicyWrap instance involved in the current PolicyWrap execution.
public string PolicyWrapKey { get; }