title: JSON Class with a List of another Class
body: <p>I'll try to explain this as best as I can. I have a class called Prospect which contains strings of email, company, firstname, lastname, phone.</p>
  
  <p>I have the requirement to ouput Prospect information in JSON in the format of </p>
  
  <pre><code>[
     {"email":"test@test.com",
        "properties":[
        {
          "property":"company",
          "value": "Company Name"
        },
          "property":"firstname",
          "value":"John"
        },
          "property":"surname",
           "value":"Smith"
        },
          "property":"phone",
          "value":"01234567891"
        }]
    }
  ]
  </code></pre>
  
  <p>I need to output JSON of all prospects I capture. I have tried this by creating a class of Customer:</p>
  
  <pre><code>public class Customer
  {
      public string email { get; set; }
      public List&lt;Property&gt; properties { get; set; }
  
  }
  </code></pre>
  
  <p>and a class of Property:</p>
  
  <pre><code>public class Property
  {
      public string property { get; set; }
      public string value { get; set; }
  }
  </code></pre>
  
  <p>I cant for the life of me get the result i am after. I thinks its the List of Property in the Customer class. If i change the List to a string and define only one value here, the output is fine.</p>
  
  <p>Please help :(</p>