Interface IStatePropertyAccessor<T>
Interface which defines methods for how you can get data from a property source, such as AgentState.
public interface IStatePropertyAccessor<T>
Type Parameters
T
type of the property.
Properties
Name
Gets the name of the property.
string Name { get; }
Property Value
- string
The name of the property.
Methods
DeleteAsync(ITurnContext, CancellationToken)
Delete the property from the source.
Task DeleteAsync(ITurnContext turnContext, CancellationToken cancellationToken = default)
Parameters
turnContext
ITurnContextTurn Context.
cancellationToken
CancellationTokenThe cancellation token.
Returns
GetAsync(ITurnContext, Func<T>, CancellationToken)
Gets the property value from the source.
Task<T> GetAsync(ITurnContext turnContext, Func<T> defaultValueFactory = null, CancellationToken cancellationToken = default)
Parameters
turnContext
ITurnContextTurn Context.
defaultValueFactory
Func<T>Function which defines the property value to be returned if no value has been set.
cancellationToken
CancellationTokenThe cancellation token.
Returns
SetAsync(ITurnContext, T, CancellationToken)
Set the property value on the source.
Task SetAsync(ITurnContext turnContext, T value, CancellationToken cancellationToken = default)
Parameters
turnContext
ITurnContextTurn Context.
value
TThe value to set.
cancellationToken
CancellationTokenThe cancellation token.