Class WMMemoryCache
Provides application-wide access to memory caching.
Inherited Members
Namespace: Quantellia.WMServer.App
Assembly: WMServer.dll
Syntax
public class WMMemoryCache : MemoryCache, IMemoryCache, IDisposable
Constructors
WMMemoryCache(MemoryCacheOptions)
Declaration
public WMMemoryCache(MemoryCacheOptions opt)
Parameters
| Type | Name | Description |
|---|---|---|
| MemoryCacheOptions | opt |
Methods
CacheObject(string, object, CacheIndices)
Attempts to cache the given dataSource to the memory cache.
Declaration
public static void CacheObject(string ID, object obj, WMMemoryCache.CacheIndices cacheIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| string | ID | The ID to cache under |
| object | obj | The dataSource to be cached |
| WMMemoryCache.CacheIndices | cacheIndex | The cache index that this object should be cached under |
DeleteCachedObject(string, CacheIndices)
Called whenever a cache is changed. This will cause the cached model to be deleted, if it exists.
Declaration
public static void DeleteCachedObject(string ID, WMMemoryCache.CacheIndices cacheIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| string | ID | The key to search under |
| WMMemoryCache.CacheIndices | cacheIndex | The cache index that this object should be deleted under |
TryGetCachedObject<T>(string, out T, CacheIndices)
Attempts to find and return the cached dataSource with the given ID.
Declaration
public static bool TryGetCachedObject<T>(string ID, out T obj, WMMemoryCache.CacheIndices cacheIndex) where T : class, new()
Parameters
| Type | Name | Description |
|---|---|---|
| string | ID | The ID the dataSource is cached against |
| T | obj | The dataSource to be returned. |
| WMMemoryCache.CacheIndices | cacheIndex | The cache index that this object should be searched for under |
Returns
| Type | Description |
|---|---|
| bool | True if the dataSource is found, false if not. |
Type Parameters
| Name | Description |
|---|---|
| T |