Share via


PersistentComponentState.TryTakeFromJson<TValue>(String, TValue) Method

Definition

Tries to retrieve the persisted state as JSON with the given key and deserializes it into an instance of type TValue. When the key is present, the state is successfully returned via instance and removed from the PersistentComponentState.

public bool TryTakeFromJson<TValue> (string key, out TValue? instance);
member this.TryTakeFromJson : string * 'Value -> bool
Public Function TryTakeFromJson(Of TValue) (key As String, ByRef instance As TValue) As Boolean

Type Parameters

TValue

Parameters

key
String

The key used to persist the instance.

instance
TValue

The persisted instance.

Returns

true if the state was found; false otherwise.

Applies to