i am trying to pass Set vlue in one method to another method in bot framework using C#
i wrote two methods
This is my first method
- if (item.PromptOption != "NULL")
- {
- if (item.PromptOption.Split('!').Length >= 1)
- {
- questionTExt = item.PromptOption.Split('!')[0];
- lstConfirmAction1 = new List<string>();
- int getLen = item.PromptOption.Split('!')[1].Split('$').Count();
- for (int i = 0; i < getLen; i++)
- {
- lstConfirmAction1.Add(item.PromptOption.Split('!')[1].Split('$')[i]);
- }
-
- }
- context.UserData.SetValue(questionTExt, questionTExt);
- var val= context.UserData.GetValue<string>(questionTExt);
- PromptDialog.Choice(context, this.OnFeedback, lstActions, questiontext, null, 3);
- }
My second method
- private async Task OnFeedback(IDialogContext context, IAwaitable<string> result)
- {
- string selectedStatus = string.Empty;
- selectedStatus = await result;
- var item = trbList1.Where(a => a.ID == childID && a.HeaderOption.ToLower() == selectedStatus.ToLower()).FirstOrDefault();
- if (!string.IsNullOrEmpty(item.Text))
- {
- if (item.Text == "break")
- {
- isTriggered = false;
- SaveQnAData(context, "YES", "TRUE");
- await context.PostAsync("Thank You");
- }
- else
- {
- var qst = context.UserData.GetValue<string>(questionTExt);
- botCon.KyraConverastionDetails.BotReply = qst;
- await context.PostAsync(item.Text);
- }
- }
- }