Pavalisoft.Caching  1.2.1
A single unified Caching Api for both MemoryCache and DistributedCache implementations including CacheManager
Pavalisoft.Caching.Cache.DistributedCache Class Reference

Provides distribution cache implementation ofICache in ICachePartition More...

Inheritance diagram for Pavalisoft.Caching.Cache.DistributedCache:
Pavalisoft.Caching.Interfaces.ICache

Public Member Functions

 DistributedCache (IExtendedDistributedCache distributedCache, ICacheStore cacheStore)
 Creates an instance of DistributedCache with IExtendedDistributedCache More...
 
TItem Get< TItem > (string key)
 Gets the Cache object for the specified cache key More...
 
async Task< TItem > GetAsync< TItem > (string key, CancellationToken token=default)
 Gets the Cache object asynchronously for the specified cache key More...
 
void Set< TItem > (string key, TItem value, ExtendedDistributedCacheEntryOptions options)
 Adds an object to distributed cache More...
 
async Task SetAsync< TItem > (string key, TItem value, ExtendedDistributedCacheEntryOptions options, CancellationToken token=default)
 Adds an object to distributed cache asynchronously More...
 
void Refresh (string key)
 Refreshes the cache item of the specified cache key More...
 
async Task RefreshAsync (string key, CancellationToken token=default)
 Refreshes the cache item asynchronously for the specified cache key More...
 
void Remove (string key)
 Removes the Cache object from the cache for the specified cache key More...
 
async Task RemoveAsync (string key, CancellationToken token=default)
 Removes the Cache object asynchronously from the cache for the specified cache key More...
 
ICacheStore< T > GetCacheStore< T > ()
 Gets the ICacheStore<T> for the type T from cache manager More...
 
void SetCacheStore< T > (ICacheStore< T > cacheStore)
 Sets the ICacheStore<T> of the type T to the cache manager More...
 

Detailed Description

Provides distribution cache implementation ofICache in ICachePartition

Constructor & Destructor Documentation

◆ DistributedCache()

Pavalisoft.Caching.Cache.DistributedCache.DistributedCache ( IExtendedDistributedCache  distributedCache,
ICacheStore  cacheStore 
)

Creates an instance of DistributedCache with IExtendedDistributedCache

Parameters
distributedCacheIExtendedDistributedCache
cacheStoreICacheStore

Member Function Documentation

◆ Get< TItem >()

TItem Pavalisoft.Caching.Cache.DistributedCache.Get< TItem > ( string  key)

Gets the Cache object for the specified cache key

Template Parameters
TItemCache object type
Parameters
keyCache key
Returns
Cached object

Implements Pavalisoft.Caching.Interfaces.ICache.

◆ GetAsync< TItem >()

async Task<TItem> Pavalisoft.Caching.Cache.DistributedCache.GetAsync< TItem > ( string  key,
CancellationToken  token = default 
)

Gets the Cache object asynchronously for the specified cache key

Template Parameters
TItemCache object type
Parameters
keyCache key
tokenCancellationToken to be used while getting cache item
Returns
Cached object

Implements Pavalisoft.Caching.Interfaces.ICache.

◆ GetCacheStore< T >()

ICacheStore<T> Pavalisoft.Caching.Cache.DistributedCache.GetCacheStore< T > ( )

Gets the ICacheStore<T> for the type T from cache manager

Template Parameters
TCache Store Type
Returns
ICacheStore<T>

Implements Pavalisoft.Caching.Interfaces.ICache.

◆ Refresh()

void Pavalisoft.Caching.Cache.DistributedCache.Refresh ( string  key)

Refreshes the cache item of the specified cache key

Parameters
keyCache key

Implements Pavalisoft.Caching.Interfaces.ICache.

◆ RefreshAsync()

async Task Pavalisoft.Caching.Cache.DistributedCache.RefreshAsync ( string  key,
CancellationToken  token = default 
)

Refreshes the cache item asynchronously for the specified cache key

Parameters
keyCache Key
tokenCancellationToken to be used while refreshing cache item

Implements Pavalisoft.Caching.Interfaces.ICache.

◆ Remove()

void Pavalisoft.Caching.Cache.DistributedCache.Remove ( string  key)

Removes the Cache object from the cache for the specified cache key

Parameters
keyCache key

Implements Pavalisoft.Caching.Interfaces.ICache.

◆ RemoveAsync()

async Task Pavalisoft.Caching.Cache.DistributedCache.RemoveAsync ( string  key,
CancellationToken  token = default 
)

Removes the Cache object asynchronously from the cache for the specified cache key

Parameters
keyCache key
tokenCancellationToken to be used while removing cache item

Implements Pavalisoft.Caching.Interfaces.ICache.

◆ Set< TItem >()

void Pavalisoft.Caching.Cache.DistributedCache.Set< TItem > ( string  key,
TItem  value,
ExtendedDistributedCacheEntryOptions  options 
)

Adds an object to distributed cache

Template Parameters
TItemCache object type
Parameters
keyCache Key
valueCache object
optionsDistributed cache options. ExtendedDistributedCacheEntryOptions

Implements Pavalisoft.Caching.Interfaces.ICache.

◆ SetAsync< TItem >()

async Task Pavalisoft.Caching.Cache.DistributedCache.SetAsync< TItem > ( string  key,
TItem  value,
ExtendedDistributedCacheEntryOptions  options,
CancellationToken  token = default 
)

Adds an object to distributed cache asynchronously

Template Parameters
TItemCache object type
Parameters
keyCache Key
valueCache object
optionsDistributed cache options. ExtendedDistributedCacheEntryOptions
tokenCancellationToken to be used while setting cache item

Implements Pavalisoft.Caching.Interfaces.ICache.

◆ SetCacheStore< T >()

void Pavalisoft.Caching.Cache.DistributedCache.SetCacheStore< T > ( ICacheStore< T >  cacheStore)

Sets the ICacheStore<T> of the type T to the cache manager

Template Parameters
TCache Store type
Parameters
cacheStoreCache Store

Implements Pavalisoft.Caching.Interfaces.ICache.


The documentation for this class was generated from the following file: