Click or drag to resize

ControllerBaseGetFromCacheIfPresentT Method (String, ControllerBaseActionWithResultT, ControllerBaseCacheOptions)

Retrieves some data from the cache or (if it is not there) executes an action and stores the result in the cache. Caching is not applied if the IgnoreCacheContext is used (depending on the parameter for it). Note: caching should only be used with great care as there are a number of potential issues involved in using it!

Namespace:  Omada.OE.AppLogic
Assembly:  Omada.OE.AppLogic (in Omada.OE.AppLogic.dll) Version: 15.0.0.0
Syntax
C#
public T GetFromCacheIfPresent<T>(
	string cacheKey,
	ControllerBaseActionWithResult<T> action,
	ControllerBaseCacheOptions options = null
)
where T : ICloneable

Parameters

cacheKey
Type: SystemString
Look for data in the cache using this key. Tip: Use BuildCacheKey() to build a cache key.
action
Type: Omada.OE.AppLogicControllerBaseActionWithResultT
Action to be performed if there is nothing in the cache.
options (Optional)
Type: Omada.OE.AppLogicControllerBaseCacheOptions

Type Parameters

T

Return Value

Type: T
Returns data either from the cache or from the result of calling the specified action.
See Also