Wrapper/Helper class around Caching
More...
|
static bool | Get< T > (ICache cache, string key, out T item) |
| Retrieves an item from the Cache More...
|
|
static void | Set< T > (ICache cache, string key, T item) |
| Sets an item into cache More...
|
|
static T | Get< T > (ICache cache, 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...
|
|
static Task< T > | GetAsync< T > (ICache cache, 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...
|
|
static void | Remove (ICache cache, string key) |
| Removes the given object from cache More...
|
|
static Task< Exception > | RemoveAsync (ICache cache, string key) |
| Removes the given object from cache More...
|
|
Wrapper/Helper class around Caching
◆ Get< T >() [1/2]
static T Sphyrnidae.Common.Cache.Caching.Get< T > |
( |
ICache |
cache, |
|
|
string |
key, |
|
|
Func< T > |
method |
|
) |
| |
|
static |
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
-
- Parameters
-
cache | The instance of the ICache interface |
key | Name of the item in cache |
method | The callback function returning the item if not initially found in cache |
- Returns
- The object from cache/callback function
◆ Get< T >() [2/2]
static bool Sphyrnidae.Common.Cache.Caching.Get< T > |
( |
ICache |
cache, |
|
|
string |
key, |
|
|
out T |
item |
|
) |
| |
|
static |
Retrieves an item from the Cache
- Template Parameters
-
- Parameters
-
cache | The instance of the ICache interface |
key | Name of the item in cache |
item | If the object is found in the Cache, this will be populated |
- Returns
- True if the object was found, False if not found
◆ GetAsync< T >()
static Task<T> Sphyrnidae.Common.Cache.Caching.GetAsync< T > |
( |
ICache |
cache, |
|
|
string |
key, |
|
|
Func< Task< T >> |
method |
|
) |
| |
|
static |
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
-
- Parameters
-
cache | The instance of the ICache interface |
key | Name of the item in cache |
method | The callback function returning the item if not initially found in cache |
- Returns
- The object from cache/callback function
◆ Remove()
static void Sphyrnidae.Common.Cache.Caching.Remove |
( |
ICache |
cache, |
|
|
string |
key |
|
) |
| |
|
static |
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 exceptions occurring during this process will be hidden
- Parameters
-
cache | The instance of the ICache interface |
key | Name of the item in cache |
◆ RemoveAsync()
static Task<Exception> Sphyrnidae.Common.Cache.Caching.RemoveAsync |
( |
ICache |
cache, |
|
|
string |
key |
|
) |
| |
|
static |
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
-
cache | The instance of the ICache interface |
key | Name 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.
◆ Set< T >()
static void Sphyrnidae.Common.Cache.Caching.Set< T > |
( |
ICache |
cache, |
|
|
string |
key, |
|
|
T |
item |
|
) |
| |
|
static |
Sets an item into cache
- Template Parameters
-
- Parameters
-
cache | The instance of the ICache interface |
key | Name of the item in cache |
item | The item being set into cache |
The documentation for this class was generated from the following file:
- C:/Users/dougb/Desktop/Sphyrnidae/New/Common/Common/Cache/Caching.cs