Share via


ConfigurationExtensibility.WritePersistedStateAsync<T> Method

Definition

Write a persisted value for an extension scoped runtime state.

public virtual System.Threading.Tasks.Task WritePersistedStateAsync<T> (string moniker, T value, System.Threading.CancellationToken cancellationToken = default);
abstract member WritePersistedStateAsync : string * 'T * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.WritePersistedStateAsync : string * 'T * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function WritePersistedStateAsync(Of T) (moniker As String, value As T, Optional cancellationToken As CancellationToken = Nothing) As Task

Type Parameters

T

Type of the value. The value is serialized/deserialized using System.Text.Json library.

Parameters

moniker
String

Moniker for the entry to write.

value
T

Value to write. The value is serialized/deserialized using System.Text.Json library.

cancellationToken
CancellationToken

Cancellation token to monitor.

Returns

A task indicating completion.

Remarks

Persisted state monikers are meant for values that persists across sessions but are not user configurable and only written/retrieved by the extension at runtime.

Applies to