Class CacheManager.DisableAutoUpdateScope
Scope class used to temporarily turn off auto-update of caches, based on table names
Inheritance
System.Object
CacheManager.DisableAutoUpdateScope
Implements
Namespace: SuperOffice.Data.Cache
Assembly: SoDataBase.dll
Syntax
public class DisableAutoUpdateScope : Object, IDisposable
Remarks
Usage:
using(UserGroupCache.GetCurrent().BeginDisableAutoUpdate())
{
... lots of updates to usergroup or usergrouplink tables
}
When the class is created, the disable-count for all tables belonging to the cache will be incremented, and automatic updates (via softtriggers from insert/update/delete sql) will be disabled. When the class is disposed, the corresponding caches will be updated once. If the disable-count falls to zero, then auto-update will also be reenabled.
Constructors
DisableAutoUpdateScope(IEnumerable<String>)
Enter scope - disable auto-update of caches depending on any of the given tables
Declaration
public DisableAutoUpdateScope(IEnumerable<string> namesToDisable)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | namesToDisable |
Methods
Dispose()
Exit scope - decrement disable-count of each given table; update each dependent cache once; wait for cache update to complete
Declaration
public void Dispose()
Implements
Extension Methods
EnumUtil.MapEnums<From, To>(From)