Share via


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

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

BotStateSet

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

Methods

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