Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.Cache.CacheNone Class Reference

Accessing cache (no cache actually used) More...

Inheritance diagram for Sphyrnidae.Common.Cache.CacheNone:
Sphyrnidae.Common.Cache.ICache

Public Member Functions

bool Get< T > (string key, out T item)
 Retrieves an item from the Cache More...
 
void Set< T > (string key, T item)
 Sets an item into cache More...
 
Get< T > (string key, Func< T > method)
 Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use More...
 
Task< T > GetAsync< T > (string key, Func< Task< T >> method)
 Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use More...
 
void Remove (string key)
 Removes the given object from cache More...
 
Task< Exception > RemoveAsync (string key)
 Removes the given object from cache More...
 

Properties

CacheOptions Options [get]
 
- Properties inherited from Sphyrnidae.Common.Cache.ICache
CacheOptions Options [get]
 The options for storing items in cache More...
 

Detailed Description

Accessing cache (no cache actually used)

Member Function Documentation

◆ Get< T >() [1/2]

T Sphyrnidae.Common.Cache.CacheNone.Get< T > ( string  key,
Func< T >  method 
)

Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use

Template Parameters
TThe type of item
Parameters
keyName of the item in cache
methodThe callback function returning the item if not initially found in cache
Returns
The object from cache/callback function

Implements Sphyrnidae.Common.Cache.ICache.

◆ Get< T >() [2/2]

bool Sphyrnidae.Common.Cache.CacheNone.Get< T > ( string  key,
out T  item 
)

Retrieves an item from the Cache

Template Parameters
TThe type of item
Parameters
keyName of the item in cache
itemIf the object is not found in the Cache, this will be populated
Returns
True if the object was found, False if not found

Implements Sphyrnidae.Common.Cache.ICache.

◆ GetAsync< T >()

Task<T> Sphyrnidae.Common.Cache.CacheNone.GetAsync< T > ( string  key,
Func< Task< T >>  method 
)

Attempts to retrieve an item from cache. If not found in cache, will make callback to obtain the item from the caller which will be stored for later use

Template Parameters
TThe type of item
Parameters
keyName of the item in cache
methodThe callback function returning the item if not initially found in cache
Returns
The object from cache/callback function

Implements Sphyrnidae.Common.Cache.ICache.

◆ Remove()

void Sphyrnidae.Common.Cache.CacheNone.Remove ( string  key)

Removes the given object from cache

Note that this removes from local cache, distributed cache, and via SignalR, all other local cache as well. Any errors in removal of the item will be hidden from the user, so it is preferred to use RemoveAsync if you need this exception handling.

Parameters
keyName of the item in cache

Implements Sphyrnidae.Common.Cache.ICache.

◆ RemoveAsync()

Task<Exception> Sphyrnidae.Common.Cache.CacheNone.RemoveAsync ( string  key)

Removes the given object from cache

Note that this removes from local cache, distributed cache, and via SignalR, all other local cache as well

Parameters
keyName of the item in cache
Returns
If an exception was thrown and the item was not fully removed, this exception will be returned. If everything succeeded, this will be null.

Implements Sphyrnidae.Common.Cache.ICache.

◆ Set< T >()

void Sphyrnidae.Common.Cache.CacheNone.Set< T > ( string  key,
item 
)

Sets an item into cache

Template Parameters
TThe type of item
Parameters
keyName of the item in cache
itemThe item being set into cache

Implements Sphyrnidae.Common.Cache.ICache.

Property Documentation

◆ Options

CacheOptions Sphyrnidae.Common.Cache.CacheNone.Options
get

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