コード例 #1
0
        private async Task <DialogTurnResult> ProcessStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            Dictionary <string, object> args = (Dictionary <string, object>)stepContext.Options;
            TokenResponse tokenResponse      = (TokenResponse)args["TokenResponse"];
            var           userProfile        = (UserProfile)stepContext.Values[UserInfo];

            var rawValues = (JObject)stepContext.Context.Activity.Value;

            int selectValue = (int)rawValues.GetValue("SingleSelectVal");

            if (selectValue == 2)
            {
                await OAuthHelpers.RemoveUserAsync(stepContext.Context, tokenResponse, userProfile.UserPrincipalName);
            }
            else
            {
                await stepContext.Context.SendActivityAsync(MessageFactory.Text($"{userProfile.DomainName} is not getting deleted"));
            }

            return(await stepContext.EndDialogAsync(null, cancellationToken));
        }