title: How to use custom reference resolving with JSON.NET
body: <p>I have the following JSON:</p>
  
  <pre><code>{
             "id" : "2"
     "categoryId" : "35"
           "type" : "item"
           "name" : "hamburger"
  }
  {
             "id" : "35"
           "type" : "category"
           "name" : "drinks" 
  }
  </code></pre>
  
  <p>And I want to match it to this object:</p>
  
  <pre><code>public class Item 
  {
    [JsonProperty(PropertyName = "categoryId")]
    public Category Category { get; set; }
  } 
  </code></pre>
  
  <p><code>Category</code> is of type <code>Entity</code> which has a <code>string</code> <code>Id</code> property I can access.  I want the "35" object created by the JSON Deserializer to be mapped to the <code>Category</code> property in the <code>Item</code>.</p>
  
  <p>According <a href="http://james.newtonking.com/projects/json/help/PreserveObjectReferences.html">to the documentation</a>, I should use a <code>IReferenceResolver</code>.  How would I implement this interface and hook it into the JSON.NET framework?</p>