Pavalisoft.Caching  1.2.1
A single unified Caching Api for both MemoryCache and DistributedCache implementations including CacheManager
Pavalisoft.Caching.Interfaces.ICacheManager Interface Reference

Represents ICacheManager implementation More...

Inheritance diagram for Pavalisoft.Caching.Interfaces.ICacheManager:
Pavalisoft.Caching.CacheManager

Public Member Functions

TItem Get< TItem > (string partitionName, string key)
 Gets cache item having specified cache key form the specified cache partitionName More...
 
Task< TItem > GetAsync< TItem > (string partitionName, string key, CancellationToken token=default)
 Gets cache item having specified cache key form the specified cache partitionName More...
 
void Set< TItem > (string partitionName, string key, TItem value, IChangeToken expirationToken=null, PostEvictionCallbackRegistration postEvictionCallback=null)
 Adds an object to distributed cache More...
 
Task SetAsync< TItem > (string partitionName, string key, TItem value, IChangeToken expirationToken=null, PostEvictionCallbackRegistration postEvictionCallback=null, CancellationToken token=default)
 Adds an object to distributed cache asynchronously More...
 
Task SetAsync< TItem > (string partitionName, string key, TItem value, IChangeToken expirationToken, CancellationToken token=default)
 Adds an object to distributed cache asynchronously without post eviction callback More...
 
Task SetAsync< TItem > (string partitionName, string key, TItem value, PostEvictionCallbackRegistration postEvictionCallback, CancellationToken token=default)
 Adds an object to distributed cache asynchronously without expiration change token More...
 
void Refresh (string partitionName, string key)
 Refreshes the cache item of the specified cache key More...
 
Task RefreshAsync (string partitionName, string key, CancellationToken token=default)
 Refreshes the cache item asynchronously for the specified cache key More...
 
void Remove (string partitionName, string key)
 Removes the Cache object from the cache for the specified cache key More...
 
Task RemoveAsync (string partitionName, string key, CancellationToken token=default)
 Removes the Cache object asynchronously from the cache for the specified cache key More...
 

Detailed Description

Represents ICacheManager implementation

Member Function Documentation

◆ Get< TItem >()

TItem Pavalisoft.Caching.Interfaces.ICacheManager.Get< TItem > ( string  partitionName,
string  key 
)

Gets cache item having specified cache key form the specified cache partitionName

Template Parameters
TItemCache object type
Parameters
partitionNameCache Partition Name
keyCache key
Returns
Cache Item of TItem

Implemented in Pavalisoft.Caching.CacheManager.

◆ GetAsync< TItem >()

Task<TItem> Pavalisoft.Caching.Interfaces.ICacheManager.GetAsync< TItem > ( string  partitionName,
string  key,
CancellationToken  token = default 
)

Gets cache item having specified cache key form the specified cache partitionName

Template Parameters
TItemCache object type
Parameters
partitionNameCache Partition Name
keyCache key
tokenCancellationToken to be used while getting cache item
Returns
Cache Item of TItem

Implemented in Pavalisoft.Caching.CacheManager.

◆ Refresh()

void Pavalisoft.Caching.Interfaces.ICacheManager.Refresh ( string  partitionName,
string  key 
)

Refreshes the cache item of the specified cache key

Parameters
partitionNameCache Partition Name
keyCache key

Implemented in Pavalisoft.Caching.CacheManager.

◆ RefreshAsync()

Task Pavalisoft.Caching.Interfaces.ICacheManager.RefreshAsync ( string  partitionName,
string  key,
CancellationToken  token = default 
)

Refreshes the cache item asynchronously for the specified cache key

Parameters
partitionNameCache Partition Name
keyCache Key
tokenCancellationToken to be used while refreshing cache item

Implemented in Pavalisoft.Caching.CacheManager.

◆ Remove()

void Pavalisoft.Caching.Interfaces.ICacheManager.Remove ( string  partitionName,
string  key 
)

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

Parameters
partitionNameCache Partition Name
keyCache key

Implemented in Pavalisoft.Caching.CacheManager.

◆ RemoveAsync()

Task Pavalisoft.Caching.Interfaces.ICacheManager.RemoveAsync ( string  partitionName,
string  key,
CancellationToken  token = default 
)

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

Parameters
partitionNameCache Partition Name
keyCache key
tokenCancellationToken to be used while removing cache item

Implemented in Pavalisoft.Caching.CacheManager.

◆ Set< TItem >()

void Pavalisoft.Caching.Interfaces.ICacheManager.Set< TItem > ( string  partitionName,
string  key,
TItem  value,
IChangeToken  expirationToken = null,
PostEvictionCallbackRegistration  postEvictionCallback = null 
)

Adds an object to distributed cache

Template Parameters
TItemCache object type
Parameters
partitionNameCache Partition Name
keyCache Key
valueCache object
expirationTokenCache IChangeToken expiration token to be used while adding cache item
postEvictionCallbackPostEvictionCallbackRegistration delegate

Implemented in Pavalisoft.Caching.CacheManager.

◆ SetAsync< TItem >() [1/3]

Task Pavalisoft.Caching.Interfaces.ICacheManager.SetAsync< TItem > ( string  partitionName,
string  key,
TItem  value,
IChangeToken  expirationToken = null,
PostEvictionCallbackRegistration  postEvictionCallback = null,
CancellationToken  token = default 
)

Adds an object to distributed cache asynchronously

Template Parameters
TItemCache object type
Parameters
partitionNameCache Partition Name
keyCache Key
valueCache object
expirationTokenCache IChangeToken expiration token to be used while adding cache item
postEvictionCallbackPostEvictionCallbackRegistration delegate
tokenCancellationToken to be used while setting cache item

Implemented in Pavalisoft.Caching.CacheManager.

◆ SetAsync< TItem >() [2/3]

Task Pavalisoft.Caching.Interfaces.ICacheManager.SetAsync< TItem > ( string  partitionName,
string  key,
TItem  value,
IChangeToken  expirationToken,
CancellationToken  token = default 
)

Adds an object to distributed cache asynchronously without post eviction callback

Template Parameters
TItemCache object type
Parameters
partitionNameCache Partition Name
keyCache Key
valueCache object
expirationTokenCache IChangeToken expiration token to be used while adding cache item
tokenCancellationToken to be used while setting cache item

Implemented in Pavalisoft.Caching.CacheManager.

◆ SetAsync< TItem >() [3/3]

Task Pavalisoft.Caching.Interfaces.ICacheManager.SetAsync< TItem > ( string  partitionName,
string  key,
TItem  value,
PostEvictionCallbackRegistration  postEvictionCallback,
CancellationToken  token = default 
)

Adds an object to distributed cache asynchronously without expiration change token

Template Parameters
TItemCache object type
Parameters
partitionNameCache Partition Name
keyCache Key
valueCache object
postEvictionCallbackPostEvictionCallbackRegistration delegate
tokenCancellationToken to be used while setting cache item

Implemented in Pavalisoft.Caching.CacheManager.


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