Struct RandomAccessCache<TKey, TValue>.ReadOrWriteSession
Represents a session that can be used to read, modify or promote the cache record value.
Implements
Inherited Members
Namespace: DotNext.Runtime.Caching
Assembly: DotNext.Threading.dll
Syntax
public readonly struct RandomAccessCache<TKey, TValue>.ReadOrWriteSession : IDisposable
Remarks
While session alive, the record cannot be evicted.
Methods
| Edit this page View SourceSetValue(TValue)
Promotes or modifies the cache record value.
Declaration
public void SetValue(TValue value)
Parameters
Type | Name | Description |
---|---|---|
TValue | value | The value to promote or replace the existing value. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | The session is invalid; the value promotes more than once. |
TryGetValue(out TValue)
Tries to get the value of the cache record.
Declaration
public bool TryGetValue(out TValue result)
Parameters
Type | Name | Description |
---|---|---|
TValue | result | The value of the cache record. |
Returns
Type | Description |
---|---|
bool |