title: PromptChoice changing options after receiving user input
body: <p>I have overridden the PromptDialog.PromptChoice for an abstract type. I have two different children that I want to share the same logic for, but I need to guarantee that certain variables are available for part of my TryParse logic. For one of the children, I don't have any issues here. However, for the other child, I am running into really bizarre behavior. When I call from my dialog CustomPromptChoice.Choice(context, function, options), I see options to be what I am expecting. The user is presented with the correct list of options, but after selecting an option, in the TryParse logic, I see that all of the options have changed. Obviously, my TryParse will always fail. Has anybody else ever seen this behavior?</p>
  
  <p>Here is the base class:</p>
  
  <pre><code>[Serializable]
  public abstract class ExtractionClass
  {
      public List&lt;ExtractionClass&gt; children;
      public ExtractionClass parent;
      public string name;
      public string value;
      public override string ToString()
      {
          return name;
      }
      public ExtractionClass() { }
      public ExtractionClass(string name, string value, ExtractionClass parent)
      {
          this.name = name;
          this.value = value;
          this.parent = parent;
      }
      //upon initialization, guarantee that children is filled correctly
      public abstract void SetChildren();
      //use to check if child is a where match
      public abstract bool IsWhereMatch(ExtractionClass child, string query="");
      //use to check if child is a when match
      public abstract bool IsWhenMatch(ExtractionClass child, string query="");
      //use to check if child is a who match
      public abstract bool IsWhoMatch(ExtractionClass child, string query="");
      //use to check if child is a what match
      public abstract bool IsWhatMatch(ExtractionClass child, string query="");
  }
  </code></pre>
  
  <p>Here is a stripped down version of the child class that doesn't work:</p>
  
  <pre><code>[Serializable]
  public class ChildClass1:ExtractionClass
  {
      public Dictionary&lt;ChildClass1, int&gt; childrenLookup;
      public Dictionary&lt;string, ChildClass1&gt; childrenNames;
      private dynamic content;
      public string spokenName;
      static HashSet&lt;string&gt; childrenToKeep = new HashSet&lt;string&gt;()
      static List&lt;string&gt; ignoreNames = new List&lt;string&gt; ();
      public static Dictionary&lt;string, List&lt;string&gt;&gt; nodeNameSynonyms = new Dictionary&lt;string, List&lt;string&gt;&gt;();
      public static HashSet&lt;string&gt; WhoNodes = new HashSet&lt;string&gt;();
      public ChildClass1(dynamic content)
      {
          this.children = new List&lt;ExtractionClass&gt;();
          this.childrenLookup = new Dictionary&lt;ChildClass1, int&gt;();
          this.childrenNames = new Dictionary&lt;string, ChildClass1&gt;();
          this.parent = null;
          this.name = String.Empty;
          this.value = String.Empty;
          this.spokenName = String.Empty;
          this.content = content;
      }
      public ChildClass1(string name, string value, List&lt;string&gt; synonyms) : this(null)
      {
          this.name = name;
          this.spokenName = name;
          double doubleValue;
          int integerValue;
          bool isInt = Int32.TryParse(value, out integerValue);
          if (isInt)
          {
              this.value = string.Format("{0}", integerValue);
          }
          else {
              bool isDouble = Double.TryParse(value, out doubleValue);
              if (isDouble)
              {
                  this.value = string.Format("{0:N2}", doubleValue);
              }
              else
              {
                  this.value = value;
              }
          }
  
      }
      public override string ToString()
      {
          return this.name;
      }
  
      public override void SetChildren()
      {
          //pretty long and complicated
      }
  
      public override bool IsWhereMatch(ExtractionClass child, string query = "")
      {
          return false;
      }
  
      public override bool IsWhenMatch(ExtractionClass child, string query = "")
      {
          return false;
      }
  
      public override bool IsWhoMatch(ExtractionClass child, string query = "")
      {
          return false;
      }
  
      public override bool IsWhatMatch(ExtractionClass child, string query = "")
      {
          return false;
      }
  }
  </code></pre>
  
  <p>And lastly, here is a stripped down version of the class that does work:</p>
  
  <pre><code>public class ChildClass2: ExtractionClass
  {
      public Address address;
      public Rating rating;
      public string description, telephone, spokenName;
  
  
      public ChildClass2(string name, string value, ExtractionClass parent) : base(name, value, parent) { children = new List&lt;ExtractionClass&gt;(); }
      public override string ToString()
      {
          return name;
      }
  
  
      public override void SetChildren()
      {
          //a bit of a mess but works as expected
      }
  
  
  }
  </code></pre>
  
  <p>What makes no sense to me though, is that I make this call in my Dialog:</p>
  
  <pre><code>ExtractionPromptChoice.Choice(context, this.CarouselEntityHandler, nodeOptions);
  </code></pre>
  
  <p>And then when I step through the stack, I see it return to the user the right options. nodeOptions in the last instance of my control is set correctly, but when I go to the ExtractionPromptChoice TryParse logic, the options are different. nodeOptions ends up holding a list of ChildClass1 types, but the promptchoice is defined for the ExtractionClass.</p>
  
  <p>Edit: It turns out that something about my code is causing the remote server to return a 400 Bad Request error in my MessagesController code.</p>