Method SetEraseObjectHandler
SetEraseObjectHandler<TKey, TValue>(Cache<TKey, TValue>, Func<TKey, Task>)
Sets an async callback method for handling erase-behind events. The object provided to the callback should be removed from a persistent backing store.
public static void SetEraseObjectHandler<TKey, TValue>(Cache<TKey, TValue> cache, Func<TKey, Task> asyncCallback)
Parameters
cache
Cache<TKey, TValue>The cache that will push erase-behind events.
asyncCallback
Func<TKey, Task>Callback that removes the provided object from a backing store.
Type Parameters
TKey
The type of keys in the cache.
TValue
The type of values in the cache.
SetEraseObjectHandler<TKey, TValue>(Cache<TKey, TValue>, Action<TKey>)
Sets a callback method for handling erase-behind events. The object provided to the callback should be removed from a persistent backing store.
public static void SetEraseObjectHandler<TKey, TValue>(Cache<TKey, TValue> cache, Action<TKey> callback)
Parameters
cache
Cache<TKey, TValue>The cache that will push erase-behind events.
callback
Action<TKey>Callback that removes the provided object from a backing store.
Type Parameters
TKey
The type of keys in the cache.
TValue
The type of values in the cache.