Show / Hide Table of Contents

Class RequestContext

This class holds information regarding the request currently being processed. It is explicitly intended to be available to application code.

Inheritance
System.Object
RequestContext
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 Source

ActivityId

Gets or sets an activity ID that can be used for correlation.

Declaration
public static Guid ActivityId { get; set; }
Property Value
Type Description
Guid
| Improve this Doc View Source

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 Source

Clear()

Declaration
public static void Clear()
| Improve this Doc View Source

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 null if no data is present for that key.

| Improve this Doc View Source

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 True if the value was previously in the RequestContext key-value bag and has now been removed, otherwise returns False.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX