Constructor ShortLivedState
ShortLivedState(IShortLivedStore, string, JsonTypeInfo<T>, TimeSpan, ILogger?)
Initializes a new instance of the ShortLivedState<T> class.
Declaration
public ShortLivedState(IShortLivedStore store, string keyPrefix, JsonTypeInfo<T> typeInfo, TimeSpan lifetime, ILogger? logger = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IShortLivedStore | store | The store. |
| string | keyPrefix | The start of the keys, which keeps these states apart from all others, for example |
| JsonTypeInfo<T> | typeInfo | The JSON type information of the state. |
| TimeSpan | lifetime | How long each state is kept after it is added. |
| ILogger | logger | The logger that a state that cannot be read is logged to, if any. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException |
|
| ArgumentOutOfRangeException |
|