SmartAPI
Open Source .NET RQL library for RedDot CMS / OpenText WSM Management Server
|
Utility class to temporarily ensure that caching on a cached list is enabled/disabled and restore the caching state afterwards. On construction the caching state is set and on disposable the original state gets restored. More...
Public Member Functions | |
CachingContext (ICachedList< T > cachedList, Caching caching) | |
void | Dispose () |
Utility class to temporarily ensure that caching on a cached list is enabled/disabled and restore the caching state afterwards. On construction the caching state is set and on disposable the original state gets restored.
In this example the caching for the ContentClasses list in a project gets disabled and then temporarily enabled for a specific scope through the use of a CachingContext. project.ContentClasses.IsCachingEnabled = false; ... using(new CachingContext<ContentClass>(project.ContentClasses, Caching.Enabled)) { ... }
T |
T | : | class |
Definition at line 33 of file CachingContext.cs.
erminas.SmartAPI.Utils.CachedCollections.CachingContext< T >.CachingContext | ( | ICachedList< T > | cachedList, |
Caching | caching | ||
) |
Definition at line 38 of file CachingContext.cs.
void erminas.SmartAPI.Utils.CachedCollections.CachingContext< T >.Dispose | ( | ) |
Definition at line 47 of file CachingContext.cs.