title: How to declare a property of an anonymous class
body: <p>In my application I must serialize/deserialize some data. Now I use code like this: </p>
  
  <pre><code>public class Outer
  {
    public Inner Inner { get; set; }
  }
  
  public class Inner
  {
    public string InnerProperty { get; set; }
  }
  </code></pre>
  
  <p>How can I avoid declaring inner class? I need something like this:</p>
  
  <pre><code>public class OuterNew
  {
  public class Inner2
      {
      public string InnerProperty { get; set; }
  } 
  }
  </code></pre>
  
  <p>But inner class must be property (have get/set) to work with serialize/deserialize correctly.</p>