Skip to content

Commit 4b01573

Browse files
takashi-uesakaKaiqb
authored andcommitted
Update bot-builder-howto-v4-state.md (#155)
1 parent 6e3890c commit 4b01573

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

articles/v4sdk/bot-builder-howto-v4-state.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public async Task OnTurn(ITurnContext context)
195195
// context object for the next turn of the conversation can check haveAskedName
196196
convo.haveAskedNameFlag = true;
197197
}
198-
else if (convo.haveAskedNumberFlag)
198+
else if (!convo.haveAskedNumberFlag)
199199
{
200200
// Save the name.
201201
var name = context.Activity.AsMessageActivity().Text;
@@ -219,7 +219,7 @@ public async Task OnTurn(ITurnContext context)
219219
}
220220
```
221221

222-
To set up user state so that it can be returned by `ConversationState<ConversationInfo>.Get(context)`,
222+
To set up user state so that it can be returned by `UserState<UserInfo>.Get(context)`,
223223
you add user state middleware. For example, in `Startup.cs` of the ASP .NET Core EchoBot, changing the code in ConfigureServices.cs:
224224

225225
```csharp
@@ -231,6 +231,7 @@ public void ConfigureServices(IServiceCollection services)
231231

232232
IStorage dataStore = new MemoryStorage();
233233
options.Middleware.Add(new ConversationState<ConversationInfo>(dataStore));
234+
options.Middleware.Add(new UserState<UserInfo>(dataStore));
234235
});
235236
}
236237
```

0 commit comments

Comments
 (0)