Class EventStateStore
Stores state data of an event.
public sealed class EventStateStore
- Inheritance
-
objectEventStateStore
- Extension Methods
Constructors
EventStateStore()
public EventStateStore()
Methods
SetValue<TValue>(string, TValue)
Sets value to the state under the key
.
public void SetValue<TValue>(string key, TValue value)
Parameters
key
stringKey associated with the value.
value
TValueValue to be set.
Type Parameters
TValue
Type of the value.
Remarks
The state allows for passing data between processing handlers if the event is a compound event consisting of multiple associated events (such as before and after events).
Exceptions
- ArgumentNullException
Thrown when
key
is null.
TryGetValue<TValue>(string, out TValue)
Gets value from the state by its key
.
public bool TryGetValue<TValue>(string key, out TValue value)
Parameters
key
stringKey associated with the value.
value
TValueWhen the method returns, contains the value associated with the
key
, or the default value ofTValue
(if the value is not found).
Returns
- bool
Returns true if the value identified by
key
is found, otherwise returns false.
Type Parameters
TValue
Type of the value.
Remarks
The state allows for passing data between processing handlers if the event is a compound event consisting of multiple associated events (such as before and after events).
Exceptions
- ArgumentNullException
Thrown when
key
is null.- InvalidCastException
Thrown when value for given
key
exists but its type is incompatible withTValue
.