You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/dotnet/bot-builder-dotnet-state.md
-52Lines changed: 0 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,58 +98,6 @@ Each [Activity][Activity] object contains properties that you will use to manage
98
98
> [!NOTE]
99
99
> You may use these property values as keys even if you opt to store state data in your own database, rather than using the Bot Framework state data store.
100
100
101
-
## <aid="state-client"></a> Create a state client
102
-
103
-
The `StateClient` object enables you to manage state data using the Bot Framework SDK for .NET.
104
-
If you have access to a message that belongs to the same context in which you want to manage state data, you can create a state client by calling the `GetStateClient` method on the `Activity` object.
105
-
106
-
[!code-csharp[Get State client](../includes/code/dotnet-state.cs#getStateClient1)]
107
-
108
-
If you do not have access to a message that belongs to the same context in which you want to manage state data, you can create a state client by simply creating a new instance of the `StateClient` class. In this example, `microsoftAppId` and `microsoftAppPassword` are the Bot Framework authentication credentials that you acquire for your bot during the [bot creation](../bot-service-quickstart.md) process.
109
-
110
-
> [!NOTE]
111
-
> To find your bot's **AppID** and **AppPassword**, see [MicrosoftAppID and MicrosoftAppPassword](~/bot-service-manage-overview.md#microsoftappid-and-microsoftapppassword).
112
-
113
-
[!code-csharp[Get State client](../includes/code/dotnet-state.cs#getStateClient2)]
114
-
115
-
> [!NOTE]
116
-
> The default state client is stored in a central service. For some channels, you may want to use a state API that is hosted within the channel itself, so that state data can be stored in a compliant store that the channel supplies.
117
-
118
-
## Get state data
119
-
120
-
Each of the "**Get...Data**" methods returns a `BotData` object that contains the state data for the specified user and/or conversation. To get a specific property value from a `BotData` object, call the `GetProperty` method.
121
-
122
-
The following code example shows how to get a typed property from user data.
123
-
124
-
[!code-csharp[Get state property](../includes/code/dotnet-state.cs#getProperty1)]
125
-
126
-
The following code example shows how to get a property from a complex type within user data.
127
-
128
-
[!code-csharp[Get state property](../includes/code/dotnet-state.cs#getProperty2)]
129
-
130
-
If no state data exists for the user and/or conversation that is specified for a "**Get...Data**" method call,
131
-
the `BotData` object that is returned will contain these property values:
132
-
-`BotData.Data` = null
133
-
-`BotData.ETag` = "*"
134
-
135
-
## Save state data
136
-
137
-
To save state data, first get the `BotData` object by calling the appropriate "**Get...Data**" method,
138
-
then update it by calling the `SetProperty` method for each property you want to update,
139
-
and save it by calling the appropriate "**Set...Data**" method.
140
-
141
-
> [!NOTE]
142
-
> You may store up to 32 kilobytes of data for each user on a channel, each conversation on a channel,
143
-
> and each user within the context of a conversation on a channel.
144
-
145
-
The following code example shows how to save a typed property in user data.
146
-
147
-
[!code-csharp[Set state property](../includes/code/dotnet-state.cs#setProperty1)]
148
-
149
-
The following code example shows how to save a property in a complex type within user data.
150
-
151
-
[!code-csharp[Set state property](../includes/code/dotnet-state.cs#setProperty2)]
152
-
153
101
## Handle concurrency issues
154
102
155
103
Your bot may receive an error response with HTTP status code **412 Precondition Failed**
Copy file name to clipboardExpand all lines: articles/javascript/bot-builder-javascript-quickstart.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ To create your bot and initialize its packages
42
42
1. If you don't already have a directory for your JavaScript bots, create one and change directories to it. (We're creating a directory foryour JavaScript botsin general, even though we're only creating one bot in this tutorial.)
0 commit comments