Class IsolatedCaches
Represents a dictionary of IAppPolicyCache for types.
Namespace: Umbraco.Core.Cache
Assembly: Umbraco.Core.dll
Syntax
public class IsolatedCaches : AppPolicedCacheDictionary<Type>, IDisposable
Remarks
Isolated caches are used by e.g. repositories, to ensure that each cached entity type has its own cache, so that lookups are fast and the repository does not need to search through all keys on a global scale.
Constructors
View SourceIsolatedCaches(Func<Type, IAppPolicyCache>)
Initializes a new instance of the IsolatedCaches class.
Declaration
public IsolatedCaches(Func<Type, IAppPolicyCache> cacheFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Func<System.Type, IAppPolicyCache> | cacheFactory |
Methods
View SourceClearCache<T>()
Clears a cache.
Declaration
public void ClearCache<T>()
Type Parameters
Name | Description |
---|---|
T |
Get<T>()
Tries to get a cache.
Declaration
public Attempt<IAppPolicyCache> Get<T>()
Returns
Type | Description |
---|---|
Attempt<IAppPolicyCache> |
Type Parameters
Name | Description |
---|---|
T |
GetOrCreate<T>()
Gets a cache.
Declaration
public IAppPolicyCache GetOrCreate<T>()
Returns
Type | Description |
---|---|
IAppPolicyCache |
Type Parameters
Name | Description |
---|---|
T |