title: Only serialize some specific properties of a class?
body: <p>I ran into a problem with Json.Net.</p>
  
  <p>My application is connected to a database and stores some data in it.
  Lets assume my application has three different classes: Entity, Group, Organisation</p>
  
  <p>Short look into Entity class:</p>
  
  <pre><code>public class Entity
  {
      [JsonIgnore]
      public int ID { get; private set; }
      [JsonProperty]
      public string UID { get; private set; }
      [JsonProperty]
      public Gender EntityGender { get; set; }
      [JsonProperty]
      public string Surname { get; set; }
      [JsonProperty]
      public string Forename { get; set; }
      [JsonProperty]
      public Group EntityGroup { get; set; }
      [JsonProperty]
      public Organisation EntityOrganisation { get; set; }
  </code></pre>
  
  <p>Organisation and Group also have an ID property.<br>
  When serializing an Entity I do not want to fully serialize EntityGroup and EntityOrganisation but only their IDs.</p>
  
  <p>Some quick example how I would like it to look like:</p>
  
  <p>(How it looks now)</p>
  
  <pre><code>{
    "UID": "6c5204356b3a1a33",
    "Surname": "Bar",
    "Forename": "Foo",
    "EntityGroup": {
      "Name": "XGroup",
      "GroupOrganisation": {
        "Name": "FooOrg"
      }
    },
    "EntityOrganisation": null,
    "EntityStation": null
  }
  </code></pre>
  
  <p>(How it should look like)</p>
  
  <pre><code>{
    "UID": "6c5204356b3a1a33",
    "Surname": "Bar",
    "Forename": "Foo",
    "EntityGroup": {
      "ID": 1,
      "GroupOrganisation": {
        "ID": 1
      }
    },
    "EntityOrganisation": null,
    "EntityStation": null
  }
  </code></pre>
  
  <p>Is it possible to setup a JsonParser that only serializes the ID property of Group and Organisation when serializing an Entity?</p>