locked
Bot Framework - Override [Optional] attribute? RRS feed

  • Question

  • I have a FormDialog that has LUIS entities bound to the state. Lets say I have something like:

     

        public abstract class AbstractFormDialog

        {

            [Optional]

            public string Entity1;

     

            [Optional]

           public string Entity2;

     

            [Optional]

            public string Entity3;

     

            [Optional]

            public string Entity4;

     

            [Optional]

            public string Entity5;

        }

     

     

    In a subclass of AbstractFormDialog, I want to be able to say that some of these entities are required, so that "no preference" is not an option. Something like

     

        public abstract class FormDialog1 : AbstractFormDialog

        {

            [Required]

            public string Entity1;

     

            [Required]

           public string Entity2;

        }

     

    Does anyone know if this is possible? Of course I could make all attributes required in the base class (removing [Optional], as this is the default behavior), and then in every class which extends it, list which entities are actually optional. This design is bad though, because if a new Entity were to be added every subclass would need to be updated.

    Wednesday, June 15, 2016 10:52 PM

Answers

  • Hi Kelsey,

    You've probably moved past this particular question, but if not, I would suggest posting it over on StackOverflow under the tag BotFramework.  There's an active audience including the Bot Framework engineering team there that should be able to help.

    --jim Lewallen

    Thursday, November 10, 2016 10:51 PM