Method SetStoreObjectHandler
SetStoreObjectHandler<TKey, TValue>(Cache<TKey, TValue>, Func<TKey, TValue, Task>)
Sets an async callback method for handling write-behind events. The object provided to the callback should be stored in a persistent backing store.
public static void SetStoreObjectHandler<TKey, TValue>(Cache<TKey, TValue> cache, Func<TKey, TValue, Task> asyncCallback)
Parameters
cacheCache<TKey, TValue>The cache that will push write-behind events.
asyncCallbackFunc<TKey, TValue, Task>Callback that writes the provided object to a backing store.
Type Parameters
TKeyThe type of keys in the cache.
TValueThe type of values in the cache.
SetStoreObjectHandler<TKey, TValue>(Cache<TKey, TValue>, Action<TKey, TValue>)
Sets a callback method for handling write-behind events. The object provided to the callback should be stored in a persistent backing store.
public static void SetStoreObjectHandler<TKey, TValue>(Cache<TKey, TValue> cache, Action<TKey, TValue> callback)
Parameters
cacheCache<TKey, TValue>The cache that will push write-behind events.
callbackAction<TKey, TValue>Callback that writes the provided object to a backing store.
Type Parameters
TKeyThe type of keys in the cache.
TValueThe type of values in the cache.