Table of Contents

Class UserState

Namespace
Microsoft.Agents.Builder.State
Assembly
Microsoft.Agents.Builder.dll

Defines a state keyed to a user.

public class UserState : AgentState, IPropertyManager, IAgentState
Inheritance
UserState
Implements
Inherited Members

Remarks

Conversation state is available in any turn in a specific conversation, regardless of user, such as in a group conversation.

Constructors

UserState(IStorage)

Defines a state keyed to a user.

public UserState(IStorage storage)

Parameters

storage IStorage

The storage layer to use.

Remarks

Conversation state is available in any turn in a specific conversation, regardless of user, such as in a group conversation.

Fields

ScopeName

public static readonly string ScopeName

Field Value

string

Methods

GetStorageKey(ITurnContext)

Gets the key to use when reading and writing state to and from storage.

protected override string GetStorageKey(ITurnContext turnContext)

Parameters

turnContext ITurnContext

The context object for this turn.

Returns

string

The storage key.

Remarks

User state includes the channel ID and user ID as part of its storage key.