Class LocalStorage
- Namespace
- GroupeIsa.Neos.Designer.UIAbstractions.SystemEnvironment
- Assembly
- GroupeIsa.Neos.Designer.UIAbstractions.dll
Represents a local storage.
[ExcludeFromCodeCoverage]
public class LocalStorage
- Inheritance
-
LocalStorage
- Inherited Members
Constructors
LocalStorage()
Initializes a new instance of the LocalStorage class.
protected LocalStorage()
Properties
Cluster
Gets the local storage whose keys are prefixed with the cluster name. The values are shared between tenants of the cluster.
public static LocalStorage Cluster { get; }
Property Value
Global
Gets the global local storage whose keys are not prefixed. The values are shared across the domain.
public static LocalStorage Global { get; }
Property Value
Tenant
Gets the local storage whose keys are prefixed with the cluster name and the tenant identifier. It is the recommended instance for most cases to avoid sharing values between tenants and clusters.
public static LocalStorage Tenant { get; }
Property Value
Methods
ContainsKey(string)
Gets a value indicating whether the key exists.
public bool ContainsKey(string key)
Parameters
keystringKey.
Returns
- bool
Value indicating whether the key exists.
FindValue<T>(string)
Finds a value.
public T FindValue<T>(string key)
Parameters
keystringKey.
Returns
- T
Value or null when the key is not found.
Type Parameters
TValue type.
GetValue<T>(string)
Gets a value.
public T GetValue<T>(string key)
Parameters
keystringKey.
Returns
- T
Value.
Type Parameters
TValue type.
Exceptions
- Exception
Exception occurs when the key is not found.
GetValue<T>(string, T)
Gets a value.
public T GetValue<T>(string key, T defaultValue)
Parameters
keystringKey.
defaultValueTDefault value.
Returns
- T
Value or default value when the key is not found.
Type Parameters
TValue type.
Remove(string)
Removes a value.
public void Remove(string key)
Parameters
keystringKey.
Set(string, object)
Sets a value.
public void Set(string key, object value)
Parameters
TryGetValue<T>(string, out T?)
Tries to get a value.
public bool TryGetValue<T>(string key, out T? value)
Parameters
keystringKey.
valueTValue.
Returns
- bool
Value indicating whether the key exists.
Type Parameters
TValue type.