Skip to content

RequestContext Methods

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

Clear

static
View source
public static void Clear()
Clears the current request context.

Get(string)

static
View source
public static object? Get(string key)
Retrieves a value from the request context.

Parameters

keystring
The key for the value to be retrieved.

Returns

The value currently associated with the provided key, otherwise null if no data is present for that key.

Remove(string)

static
View source
public static bool Remove(string key)
Remove a value from the request context.

Parameters

keystring
The key for the value to be removed.

Returns

true if the value was previously in the request context and has now been removed, otherwise false.

Set(string, object)

static
View source
public static void Set(string key, object value)
Sets a value in the request context.

Parameters

keystring
The key for the value to be updated or added.
valueobject
The value to be stored into the request context.