{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/732","repository_url":"https://api.github.com/repos/Microsoft/BotBuilder","labels_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/732/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/732/comments","events_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/732/events","html_url":"https://github.com/Microsoft/BotBuilder/issues/732","id":166015867,"number":732,"title":"PrivateConversationData is not being saved in V3.0 (C# SDK)","user":{"login":"kienct89","id":3182992,"avatar_url":"https://avatars.githubusercontent.com/u/3182992?v=3","gravatar_id":"","url":"https://api.github.com/users/kienct89","html_url":"https://github.com/kienct89","followers_url":"https://api.github.com/users/kienct89/followers","following_url":"https://api.github.com/users/kienct89/following{/other_user}","gists_url":"https://api.github.com/users/kienct89/gists{/gist_id}","starred_url":"https://api.github.com/users/kienct89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kienct89/subscriptions","organizations_url":"https://api.github.com/users/kienct89/orgs","repos_url":"https://api.github.com/users/kienct89/repos","events_url":"https://api.github.com/users/kienct89/events{/privacy}","received_events_url":"https://api.github.com/users/kienct89/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-18T04:06:54Z","updated_at":"2016-07-18T07:02:44Z","closed_at":null,"body":"Hi,\r\n\r\nI'm having problems with saving and retrieving **PrivateConversationData** using new **BotStateClient** in latest C# v3.0 SDK.\r\n\r\nCode Sample:\r\n\r\n1. **Save**\r\n\r\n```\r\npublic static void SavePrivateConversationData(this Activity activity, params KeyValuePair<string, object>[] keyValues)\r\n{\r\n     var stateClient = activity.GetStateClient();\r\n     var privateConversationData = stateClient.BotState.GetPrivateConversationData(activity.ChannelId, activity.Conversation.Id, activity.From.Id);\r\n     foreach (var keyValue in keyValues)\r\n     {\r\n          privateConversationData.SetProperty(keyValue.Key, keyValue.Value);\r\n     }\r\n     stateClient.BotState.SetPrivateConversationData(activity.ChannelId, activity.Conversation.Id, activity.From.Id, privateConversationData);\r\n}\r\n```\r\n\r\n```\r\nactivity.SavePrivateConversationData(new KeyValuePair<string, object>(\"persistedCookie\", resumptionCookie));\r\n```\r\n\r\n2. **Load**\r\n\r\n```\r\npublic static TType LoadPrivateConversationData<TType>(this Activity activity, string key = null) where TType : class\r\n{\r\n     var stateClient = activity.GetStateClient();\r\n     var privateConversationData = stateClient.BotState.GetPrivateConversationData(activity.ChannelId, activity.Conversation.Id, activity.From.Id);\r\n     var property = privateConversationData.GetProperty<TType>(key);\r\n     return property;\r\n}\r\n```\r\n\r\n`\r\nvar pending = activity.LoadPrivateConversationData<ResumptionCookie>(\"persistedCookie\");\r\n`\r\n\r\nAdditional Notes:\r\n- if I debug or load the private conversation data **right after it being added**, the data is there. However, on the next request, the data is gone\r\n- `IBotContext.PrivateConversationData.SetValue();` => this method is still working as expected.\r\n\r\nThanks,\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/comments/233248930","html_url":"https://github.com/Microsoft/BotBuilder/issues/732#issuecomment-233248930","issue_url":"https://api.github.com/repos/Microsoft/BotBuilder/issues/732","id":233248930,"user":{"login":"kienct89","id":3182992,"avatar_url":"https://avatars.githubusercontent.com/u/3182992?v=3","gravatar_id":"","url":"https://api.github.com/users/kienct89","html_url":"https://github.com/kienct89","followers_url":"https://api.github.com/users/kienct89/followers","following_url":"https://api.github.com/users/kienct89/following{/other_user}","gists_url":"https://api.github.com/users/kienct89/gists{/gist_id}","starred_url":"https://api.github.com/users/kienct89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kienct89/subscriptions","organizations_url":"https://api.github.com/users/kienct89/orgs","repos_url":"https://api.github.com/users/kienct89/repos","events_url":"https://api.github.com/users/kienct89/events{/privacy}","received_events_url":"https://api.github.com/users/kienct89/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T07:02:44Z","updated_at":"2016-07-18T07:02:44Z","body":"@NanashiGIT do you have any workround for now?\r\n"}}
{"actor":{"display_login":"kienct89"}}