Table of Contents

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. Do not re-use an instance of Context across more than one execution.

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 string

The 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 string

The 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

Guid

ExecutionKey

A key unique to the call site of the current execution. The value is set

public string ExecutionKey { get; }

Property Value

string

PolicyKey

A key unique to the Policy instance executing the current delegate.

public string PolicyKey { get; }

Property Value

string

PolicyWrapKey

A key unique to the outermost PolicyWrap instance involved in the current PolicyWrap execution.

public string PolicyWrapKey { get; }

Property Value

string