Table of Contents

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

LocalStorage

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

LocalStorage

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

LocalStorage

Methods

ContainsKey(string)

Gets a value indicating whether the key exists.

public bool ContainsKey(string key)

Parameters

key string

Key.

Returns

bool

Value indicating whether the key exists.

FindValue<T>(string)

Finds a value.

public T FindValue<T>(string key)

Parameters

key string

Key.

Returns

T

Value or null when the key is not found.

Type Parameters

T

Value type.

GetValue<T>(string)

Gets a value.

public T GetValue<T>(string key)

Parameters

key string

Key.

Returns

T

Value.

Type Parameters

T

Value 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

key string

Key.

defaultValue T

Default value.

Returns

T

Value or default value when the key is not found.

Type Parameters

T

Value type.

Remove(string)

Removes a value.

public void Remove(string key)

Parameters

key string

Key.

Set(string, object)

Sets a value.

public void Set(string key, object value)

Parameters

key string

Key.

value object

Value.

TryGetValue<T>(string, out T?)

Tries to get a value.

public bool TryGetValue<T>(string key, out T? value)

Parameters

key string

Key.

value T

Value.

Returns

bool

Value indicating whether the key exists.

Type Parameters

T

Value type.