Class IsolatedRuntimeCache
Used to get/create/manipulate isolated runtime cache
Inheritance
System.Object
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public class IsolatedRuntimeCache
Remarks
This is useful for repository level caches to ensure that cache lookups by key are fast so that the repository doesn't need to search through all keys on a global scale.
Constructors
IsolatedRuntimeCache(Func<Type, IRuntimeCacheProvider>)
Constructor that allows specifying a factory for the type of runtime isolated cache to create
Declaration
public IsolatedRuntimeCache(Func<Type, IRuntimeCacheProvider> cacheFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Type, IRuntimeCacheProvider> | cacheFactory |
Methods
ClearAllCaches()
Clears all of the isolated caches
Declaration
public void ClearAllCaches()
ClearCache<T>()
Clears all values inside this isolated runtime cache
Declaration
public void ClearCache<T>()
Type Parameters
Name | Description |
---|---|
T |
GetCache<T>()
Tries to get a cache by the type specified
Declaration
public Attempt<IRuntimeCacheProvider> GetCache<T>()
Returns
Type | Description |
---|---|
Attempt<IRuntimeCacheProvider> |
Type Parameters
Name | Description |
---|---|
T |
GetOrCreateCache(Type)
Returns an isolated runtime cache for a given type
Declaration
public IRuntimeCacheProvider GetOrCreateCache(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type |
Returns
Type | Description |
---|---|
IRuntimeCacheProvider |
GetOrCreateCache<T>()
Returns an isolated runtime cache for a given type
Declaration
public IRuntimeCacheProvider GetOrCreateCache<T>()
Returns
Type | Description |
---|---|
IRuntimeCacheProvider |
Type Parameters
Name | Description |
---|---|
T |