title: Deserialize property from JSON twice?
body: <p>I have a weird problem:</p>
  
  <p>I have a class A which contains a subclass B. class A is rather complex and changes frequently. I do need only a small fraction of the properties of class A and a complete json representation of class B, to pass it on to a different service.</p>
  
  <p>This looks like this</p>
  
  <pre><code>[DataContact]
  public class A 
  {
      [DataMember]
      public B Inner {get; set;}
  }
  
  [DataContact]
  public class B 
  {
      [DataMember]
      public int SomeThing {get; set;}
  }
  </code></pre>
  
  <p>What I would like to achieve is this:</p>
  
  <pre><code>[DataContact]
  public class ADesired
  {
      [DataMember]
      public B Inner {get; set;}
  
      [DataMember]
      public string InnerAsJsonString {get; set;}
  }
  </code></pre>
  
  <p>I tried the most obvious ideas (e.g. a Jsonproperty which refers to the same name, but NewtonSoft.Json refusses to make this work)</p>
  
  <p>What I have tried so far:</p>
  
  <ol>
  <li><p>JsonConverter, did not work at all.</p></li>
  <li><p>JsonProperties:</p>
  
  <pre><code>[DataContact]
  public class ADesired
  {
      [JsonProperty("Source")]
      public B Inner {get; set;}
  
      [JsonProperty("Source")]
      public string InnerAsJsonString {get; set;}
  }
  </code></pre>
  
  <p>Which does not work at runtime, since the reference to the same property is detected.</p></li>
  <li><p>Nuclear option: Just deserialize the string twice in the controller, but this feels just wrong.</p></li>
  </ol>