AgentState Class
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.
Base class for AgentState key/value state.
public abstract class AgentState : Microsoft.Agents.Builder.State.IAgentState, Microsoft.Agents.Builder.State.IPropertyManager
type AgentState = class
interface IPropertyManager
interface IAgentState
Public MustInherit Class AgentState
Implements IAgentState, IPropertyManager
- Inheritance
-
AgentState
- Derived
- Implements
Constructors
| AgentState(IStorage, String) |
Initializes a new instance of the AgentState class. |
Properties
| Name |
The scope name of the state. |
Methods
| ClearState() |
Clears the state. |
| CreateProperty<T>(String) |
Obsolete.
Creates a named state property within the scope of a AgentState and returns an accessor for the property. |
| DeletePropertyValue(String) |
Deletes a property from the state cache for this AgentState. |
| DeleteStateAsync(ITurnContext, CancellationToken) |
Deletes state in storage. |
| DeleteValue(String) |
Delete a property. |
| GetPropertyValue<T>(String) |
Gets the value of a property from the state cache for this AgentState. |
| GetStorageKey(ITurnContext) |
When overridden in a derived class, gets the key to use when reading and writing state to and from storage. |
| GetValue<T>(String, Func<T>) |
Get a property value. |
| HasValue(String) |
Checks for the existence of a property. |
| IsLoaded() |
True if state has been loaded. |
| LoadAsync(ITurnContext, Boolean, CancellationToken) |
Populates state from the storage layer. |
| SaveChangesAsync(ITurnContext, Boolean, CancellationToken) |
Writes state to the storage layer. |
| SetPropertyValue(String, Object) |
Sets the value of a property in the state cache for this AgentState. |
| SetValue<T>(String, T) |
Set a property value. |
| TryGetValue<T>(String, T) | |