SmartAPI
Open Source .NET RQL library for RedDot CMS / OpenText WSM Management Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
erminas.SmartAPI.Utils.CachedCollections.CachingContext< T > Class Template Reference

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...

+ Inheritance diagram for erminas.SmartAPI.Utils.CachedCollections.CachingContext< T >:
+ Collaboration diagram for erminas.SmartAPI.Utils.CachedCollections.CachingContext< T >:

Public Member Functions

 CachingContext (ICachedList< T > cachedList, Caching caching)
 
void Dispose ()
 

Detailed Description

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)) { ... }

Template Parameters
T
Type Constraints
T :class 

Definition at line 33 of file CachingContext.cs.

Constructor & Destructor Documentation

erminas.SmartAPI.Utils.CachedCollections.CachingContext< T >.CachingContext ( ICachedList< T >  cachedList,
Caching  caching 
)

Definition at line 38 of file CachingContext.cs.

Member Function Documentation

void erminas.SmartAPI.Utils.CachedCollections.CachingContext< T >.Dispose ( )

Definition at line 47 of file CachingContext.cs.


The documentation for this class was generated from the following file: