Click or drag to resize
LockHelperEnsureT Method (T, FuncT, Object)
Ensures the value of the given variable in a locked context to prevent multiple loads. Uses the loadMethod to populate the value

Namespace: CMS.Base
Assembly: CMS.Base (in CMS.Base.dll) Version: 8.2.23
Syntax
C#
public static T Ensure<T>(
	ref T variable,
	Func<T> loadMethod,
	Object lockObject
)
where T : class

Parameters

variable
Type: T
Variable to load
loadMethod
Type: SystemFuncT
Methods that provides the variable value
lockObject
Type: SystemObject
Object to use for locking context to ensure only one load

Type Parameters

T

Return Value

Type: T
See Also