Deleting an account using the bot

In this step, I will explain how to build a FormFlow to delete an account using this bot.

Add the following class to delete an account:

class DeleteAccount     {         [Prompt("Are you sure want to delete your account?")]         public string DeleteConfirmationMessage;         public string DeleteSuccessMessage;     }; 

To delete an account, we need the account number. Define a field for the DeleteAccount class and one more field for the account number in the Customer class, as follows:

public DeleteAccount Delete;         [Template(TemplateUsage.EnumSelectOne, "Please select your {&}         {||}", ChoiceStyle = ChoiceStyleOptions.PerLine)]         public string AccountNumber; 

Append the following code to the builder object before OnCompletion(accountStatus) ...

Get Building Bots with Microsoft Bot Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.