Click or drag to resize
IProgressiveCacheLoadTData Method
Loads data. If multiple threads are loading the same data, only one thread executes the load, stores the result into cache and the result is distributed to other waiting threads. If an exception is thrown during loadDataFunc execution, the exception is distributed as well. No data are cached in such a case.

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 13.0.131
Syntax
C#
TData Load<TData>(
	Func<CacheSettings, TData> loadDataFunc,
	CacheSettings settings
)

Parameters

loadDataFunc
Type: SystemFuncCacheSettings, TData
Function accepting cache settings and returning the data.
settings
Type: CMS.HelpersCacheSettings
Settings configuring the cache.

Type Parameters

TData
Type of data to be loaded.

Return Value

Type: TData
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown when loadDataFunc or settings is null.
Remarks

Based on the settings the data is stored into cache. If Cached is set to false, no caching is performed and fresh data are retrieved.

If both progressive load is allowed (both AllowProgressiveCaching and ProgressiveCaching are set to true), the fresh data retrieval is subject to progressive load (i.e. only one threads executes the load and the result is distributed to other waiting threads). Otherwise, the loadDataFunc is always executed.

The internals of the method are based on CachedSectionTData.

See Also