Interface IMigrationCache<TKey, TValue>
Interface for a cache containing data relevant to an ongoing migration.
Inherited Members
Namespace: Tableau.Migration.Engine.Caching
Assembly: Tableau.Migration.dll
Syntax
public interface IMigrationCache<TKey, TValue> : IDisposable where TKey : notnull where TValue : class
Type Parameters
Name | Description |
---|---|
TKey | The key type. |
TValue | The value type. |
Methods
Add(TKey, TValue)
Adds a value to the cache.
Declaration
void Add(TKey key, TValue value)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key to add the value for. |
TValue | value | The value to add. |
GetOrAddAsync(TKey, CancellationToken)
Gets or retrieves a value from the cache.
Declaration
Task<IResult<TValue>> GetOrAddAsync(TKey key, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key to get or retrive a value for. |
CancellationToken | cancel | The cancellation token to obey. |
Returns
Type | Description |
---|---|
Task<IResult<TValue>> | A result with the cached or retrieved value, or any errors that occurred. |