AdapterExtensions.UseState Method
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.
Caution
This method is deprecated in 4.9. You should use the method .UseBotState() instead.
[System.Obsolete("This method is deprecated in 4.9. You should use the method .UseBotState() instead.")]
public static Microsoft.Bot.Builder.BotAdapter UseState (this Microsoft.Bot.Builder.BotAdapter botAdapter, Microsoft.Bot.Builder.UserState userState, Microsoft.Bot.Builder.ConversationState conversationState, bool auto = true);
[<System.Obsolete("This method is deprecated in 4.9. You should use the method .UseBotState() instead.")>]
static member UseState : Microsoft.Bot.Builder.BotAdapter * Microsoft.Bot.Builder.UserState * Microsoft.Bot.Builder.ConversationState * bool -> Microsoft.Bot.Builder.BotAdapter
<Extension()>
Public Function UseState (botAdapter As BotAdapter, userState As UserState, conversationState As ConversationState, Optional auto As Boolean = true) As BotAdapter
Parameters
- botAdapter
- BotAdapter
The BotAdapter on which to register the objects.
- conversationState
- ConversationState
The ConversationState object to register.
- auto
- Boolean
true
to automatically persist state each turn; otherwise, false
.
When false, it is your responsibility to persist state each turn.
Returns
The updated adapter.
- Attributes
Remarks
This adds IMiddleware to register the user and conversation state management objects. If auto
is true, this also adds middleware to automatically persist state before each turn ends.