I write a FormFlow demo by review the guidelines https://docs.botframework.com/en-us/csharp/builder/sdkreference/forms.html, it work well.
In the demo "Simple Sandwich Bot" , Sandwich.cs , there are enum:
public List Toppings;
public List Sauce;
public enum ToppingOptions
{
Avocado, BananaPeppers, Cucumbers, GreenBellPeppers, Jalapenos,
Lettuce, Olives, Pickles, RedOnion, Spinach, Tomatoes
};
public enum SauceOptions
{
ChipotleSouthwest, HoneyMustard, LightMayonnaise, RegularMayonnaise,
Mustard, Oil, Pepper, Ranch, SweetOnion, Vinegar
};
when the code is running, and to choice ToppingOptions and SauceOptions,
the first option is missing.Is this a bug?
a picture to show the result
First of all, in the example they declare the list as a 'ToppingOptions' value, use List<ToppingOptions> instead of List only, if it doesn't work still, try to change the first value of the enums and set it = 1, and keep the others like that
public enum ToppingOptions
{
Avocado = 1, BananaPeppers, Cucumbers, GreenBellPeppers, Jalapenos,
Lettuce, Olives, Pickles, RedOnion, Spinach, Tomatoes
};
public enum SauceOptions
{
ChipotleSouthwest = 1, HoneyMustard, LightMayonnaise, RegularMayonnaise,
Mustard, Oil, Pepper, Ranch, SweetOnion, Vinegar
};
As you said in the comment, the guidlines is describe:"If a field is based on an enum and it is not nullable, then the 0 value in the enum is considered to be null and you should start your enumeration at 1."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With