BotState.SaveChangesAsync(ITurnContext, Boolean, CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Writes the state cache for this BotState to the storage layer.
public virtual System.Threading.Tasks.Task SaveChangesAsync (Microsoft.Bot.Builder.ITurnContext turnContext, bool force = false, System.Threading.CancellationToken cancellationToken = default);
abstract member SaveChangesAsync : Microsoft.Bot.Builder.ITurnContext * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.SaveChangesAsync : Microsoft.Bot.Builder.ITurnContext * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function SaveChangesAsync (turnContext As ITurnContext, Optional force As Boolean = false, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameters
- turnContext
- ITurnContext
The context object for this turn.
- force
- Boolean
Optional, true
to save the state cache to storage;
or false
to save state to storage only if a property in the cache has changed.
- 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.
Exceptions
turnContext
is null
.