Language

AutoSaveStateMiddleware Class

Definition

Middleware to automatically persist state before the end of each turn.

public class AutoSaveStateMiddleware : Microsoft.Bot.Builder.IMiddleware
type AutoSaveStateMiddleware = class
    interface IMiddleware
Public Class AutoSaveStateMiddleware
Implements IMiddleware
Inheritance
AutoSaveStateMiddleware
Implements

Remarks

This calls SaveChangesAsync(ITurnContext, Boolean, CancellationToken) on each state object it manages.

Constructors

Name Description
AutoSaveStateMiddleware(BotState[])

Initializes a new instance of the AutoSaveStateMiddleware class.

AutoSaveStateMiddleware(BotStateSet)

Initializes a new instance of the AutoSaveStateMiddleware class with a list of state management objects managed by this object.

Properties

Name Description
BotStateSet

Gets or sets the list of state management objects managed by this object.

Methods

Name Description
Add(BotState)

Adds a state management object to the list of states to manage.

OnTurnAsync(ITurnContext, NextDelegate, CancellationToken)

Before the turn ends, calls SaveChangesAsync(ITurnContext, Boolean, CancellationToken) on each state object.

Applies to