title: Is it possible to have class members of an anonymous class?
body: <p>I'm trying to create a class that has fields in it that are of an anonymous type. (This is for Json deserialization.)</p>
  
  <p>I can't find a syntax that the compiler will accept. I'm trying:</p>
  
  <pre><code>class Foo {
      var Bar = new {
          int num;
      }
      var Baz = new {
          int[] values;
      }
  }
  </code></pre>
  
  <p>This is supposed to represent this example Json object:</p>
  
  <pre><code>{
      "Bar": { "num": 0 }
      "Baz": { "values": [0, 1, 2] }
  }
  </code></pre>
  
  <p>Is this even possible, or must I declare each class normally with a full class identifier?</p>