Pavalisoft.Caching  1.2.1
A single unified Caching Api for both MemoryCache and DistributedCache implementations including CacheManager
All Classes Namespaces Functions Variables Properties
Pavalisoft.Caching.Interfaces.ICache Interface Reference

Represents a ICache in ICachePartition implementation More...

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

Public Member Functions

TItem Get< TItem > (string key)
 Gets the Cache object for the specified cache key More...
 
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...
 
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...
 
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...
 
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

Represents a ICache in ICachePartition implementation

Member Function Documentation

◆ Get< TItem >()

TItem Pavalisoft.Caching.Interfaces.ICache.Get< TItem > ( string  key)

Gets the Cache object for the specified cache key

Template Parameters
TItemCache object type
Parameters
keyCache key
Returns
Cached object

Implemented in Pavalisoft.Caching.Cache.DistributedCache.

◆ GetAsync< TItem >()

Task<TItem> Pavalisoft.Caching.Interfaces.ICache.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

Implemented in Pavalisoft.Caching.Cache.DistributedCache.

◆ GetCacheStore< T >()

ICacheStore<T> Pavalisoft.Caching.Interfaces.ICache.GetCacheStore< T > ( )

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

Template Parameters
TCache Store Type
Returns
ICacheStore<T>

Implemented in Pavalisoft.Caching.Cache.DistributedCache.

◆ Refresh()

void Pavalisoft.Caching.Interfaces.ICache.Refresh ( string  key)

Refreshes the cache item of the specified cache key

Parameters
keyCache key

Implemented in Pavalisoft.Caching.Cache.DistributedCache.

◆ RefreshAsync()

Task Pavalisoft.Caching.Interfaces.ICache.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

Implemented in Pavalisoft.Caching.Cache.DistributedCache.

◆ Remove()

void Pavalisoft.Caching.Interfaces.ICache.Remove ( string  key)

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

Parameters
keyCache key

Implemented in Pavalisoft.Caching.Cache.DistributedCache.

◆ RemoveAsync()

Task Pavalisoft.Caching.Interfaces.ICache.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

Implemented in Pavalisoft.Caching.Cache.DistributedCache.

◆ Set< TItem >()

void Pavalisoft.Caching.Interfaces.ICache.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

Implemented in Pavalisoft.Caching.Cache.DistributedCache.

◆ SetAsync< TItem >()

Task Pavalisoft.Caching.Interfaces.ICache.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

Implemented in Pavalisoft.Caching.Cache.DistributedCache.

◆ SetCacheStore< T >()

void Pavalisoft.Caching.Interfaces.ICache.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

Implemented in Pavalisoft.Caching.Cache.DistributedCache.


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