Class RequestContext
This class holds information regarding the request currently being processed. It is explicitly intended to be available to application code.
Inheritance
Namespace: Orleans.Runtime
Assembly: Orleans.Core.Abstractions.dll
Syntax
public static class RequestContext : object
Remarks
The request context is represented as a property bag. Some values are provided by default; others are derived from messages headers in the request that led to the current processing.
Information stored in RequestContext is propagated from Orleans clients to Orleans grains automatically by the Orleans runtime.
Properties
| Improve this Doc View SourceActivityId
Gets or sets an activity ID that can be used for correlation.
Declaration
public static Guid ActivityId { get; set; }
Property Value
| Type | Description |
|---|---|
| Guid |
PropagateActivityId
Whether Trace.CorrelationManager.ActivityId settings should be propagated into grain calls.
Declaration
public static bool PropagateActivityId { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
| Improve this Doc View SourceClear()
Declaration
public static void Clear()
Get(String)
Retrieve a value from the RequestContext key-value bag.
Declaration
public static object Get(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key for the value to be retrieved. |
Returns
| Type | Description |
|---|---|
| System.Object | The value currently in the RequestContext for the specified key,
otherwise returns |
Remove(String)
Remove a value from the RequestContext key-value bag.
Declaration
public static bool Remove(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key for the value to be removed. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Boolean |
Set(String, Object)
Sets a value into the RequestContext key-value bag.
Declaration
public static void Set(string key, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The key for the value to be updated / added. |
| System.Object | value | The value to be stored into RequestContext. |