Table of Contents

Interface IActivityContext

Namespace
Excalibur.Domain
Assembly
Excalibur.Domain.dll

Defines a context for accessing activity scoped information.

public interface IActivityContext
Extension Methods

Methods

ContainsKey(string)

Checks if the context contains a value for the specified key.

bool ContainsKey(string key)

Parameters

key string

The key to check for existence in the context.

Returns

bool

true if the key exists in the context; otherwise, false .

GetValue<T>(string, T)

Retrieves a value from the context by its key, or returns a default value if the key is not found.

T GetValue<T>(string key, T defaultValue)

Parameters

key string

The key associated with the value to retrieve.

defaultValue T

The default value to return if the key does not exist or the value is null .

Returns

T

The value associated with the specified key, or defaultValue if the key does not exist.

Type Parameters

T

The type of the value to retrieve.

Exceptions

ArgumentException

Thrown if key is null , empty, or whitespace.

Remove(string)

Removes a value from the context for the specified key.

void Remove(string key)

Parameters

key string

The key associated with the value to remove.

Exceptions

ArgumentException

Thrown if key is null , empty, or whitespace.

SetValue<T>(string, T)

Sets a value in the context for the specified key.

void SetValue<T>(string key, T value)

Parameters

key string

The key to associate with the value.

value T

The value to store in the context.

Type Parameters

T

The type of the value to set.

Exceptions

ArgumentException

Thrown if key is null , empty, or whitespace.