Table of Contents

Interface IAsyncPersistable

Namespace
Ecng.Serialization
Assembly
Ecng.Serialization.dll

Interface for objects whose state can be persisted asynchronously using a SettingsStorage.

public interface IAsyncPersistable
Extension Methods

Methods

LoadAsync(SettingsStorage, CancellationToken)

Asynchronously loads the state of the object from the specified SettingsStorage.

Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)

Parameters

storage SettingsStorage

The SettingsStorage instance from which to load the data.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous load operation.

SaveAsync(SettingsStorage, CancellationToken)

Asynchronously saves the state of the object to the specified SettingsStorage.

Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)

Parameters

storage SettingsStorage

The SettingsStorage instance to which to save the data.

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task

A task that represents the asynchronous save operation.