| LockHelperEnsureT Method (T, Object) |
Ensures the value of the given variable in a locked context to prevent multiple loads.
Uses the default constructor of T to initialize the value.
Namespace: CMS.BaseAssembly: CMS.Base (in CMS.Base.dll) Version: 13.0.131
Syntaxpublic static T Ensure<T>(
ref T variable,
Object lockObject
)
where T : class, new()
Parameters
- variable
- Type: T
Variable to load - lockObject
- Type: SystemObject
Object to use for locking context to ensure only one load
Type Parameters
- T
Return Value
Type:
T
Exceptions| Exception | Condition |
|---|
| ArgumentNullException | Throws when lock object is not defined |
See Also