Share via


BotStateMemoryScope<T>.LoadAsync Method

Definition

Populates the state cache for this BotState from the storage layer.

public override System.Threading.Tasks.Task LoadAsync (Microsoft.Bot.Builder.Dialogs.DialogContext dialogContext, bool force = false, System.Threading.CancellationToken cancellationToken = default);
override this.LoadAsync : Microsoft.Bot.Builder.Dialogs.DialogContext * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overrides Function LoadAsync (dialogContext As DialogContext, Optional force As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

dialogContext
DialogContext

The dialog context object for this turn.

force
Boolean

Optional, true to overwrite any existing state cache; or false to load state from storage only if the cache doesn't already exist.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Applies to