title: Json.Net custom serialization from attribute
body: <p>I've read the docs on json.net pretty well, and I'm running out of ideas.  I have a situation where I have children with references to there parents.  So</p>
  <pre><code>public class ObjA
  {
    public int Id {get;set}
    public string OtherStuff {get;set}
    public ObjB MyChild {get;set}
  }
  
  public class ObjB
  {
    public int Id {get;set}
    public string OtherStuff {get;set}
    public ObjA MyParent {get;set}
  }
  </code></pre>
  <p>This wont serialize.  So I could do [JsonIgnore] but what I'd rather do is do [JsonIdOnly] where ObjB, instead of having a serialization of MyParent or skipping MyParent entirely shows a json property for MyParentId:123.  So</p>
  <pre><code>{OjbA:{
      Id:123,
      OtherStuff:some other stuff,
      MyChild:{
          Id:456,
          OtherStuff:Some other stuff,
          MyParentId:123,
          }
      }
   }
  </code></pre>
  <p>I know I can write a custom converter for a type.  THe problem is that I want this to happen only when designated because otherwise I would not be able to serialize ObjA.  In other words I need this to happen only when i decorate it with an attribute. So</p>
  <pre><code>public class ObjB
  {
    public int Id {get;set}
    public string OtherStuff {get;set}
    [JsonIdOnly]
    public ObjA MyParent {get;set}
  }
  </code></pre>