title: How To Serialize a class that derives from a Dictionary
body: <p>I am attempting to serialize/deserialize the following class to and from Json using Json.Net:</p>
  
  <pre><code>public class ChildDictionary:Dictionary&lt;Employee, double&gt;
  {
  
      public string Name { get; set; }
  
  }
  </code></pre>
  
  <p>I have found the information <a href="http://www.newtonsoft.com/json/help/html/SerializeDictionary.htm" rel="nofollow">here</a>, <a href="http://www.newtonsoft.com/json/help/html/serializationguide.htm#Dictionarys" rel="nofollow">here</a>, and <a href="http://www.newtonsoft.com/json/help/html/SerializingCollections.htm" rel="nofollow">here</a> that are related but none of them deal specifically with what the syntax should look like for this case where we derive from a Dictionary.</p>
  
  <p>Employee successfully serializes with Json.Net on its own. It looks like this: </p>
  
  <pre><code>[JsonObject(MemberSerialization.OptIn)]
  public class Employee
  {
  
      [JsonProperty]
      public string Name { get; set; }
  
      [JsonProperty]
      public double Factor { get; set; }
  
      [JsonProperty]
      public List&lt;ILoadBuilder&gt; LoadBuilders = new List&lt;ILoadBuilder&gt;();
  
      [JsonConstructor]
      public LoadCause(string name, double factor, List&lt;ILoadBuilder&gt; loadBuilders)
      {
          this.Name = name;
          this.DurationFactor = Factor;
          this.LoadBuilders = loadBuilders;
      }
  }
  </code></pre>
  
  <p>I don't care what the Json looks like in the end as long as I can write and read it without losing data</p>
  
  <p>Any suggestions of what the code to accomplish this should look like? Both a Custom JsonConverter or Attributes are fine solutions.</p>