title: Mongo DB object Id deserializing using JSON serializer
body: <pre><code>var docToJson = doc.ToJson&lt;BsonDocument&gt;();
  story Featured = JsonConvert.DeserializeObject&lt;story&gt;(docToJson);
  
  
  public class story 
  {
  [JsonProperty("_id"), JsonConverter(typeof(ObjectIdConverter))]
  public ObjectId Id { get; set; }
  ....
  
  public class ObjectIdConverter : JsonConverter
  {
          public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
          {
              serializer.Serialize(writer, value.ToString());
          }
  
          public override object ReadJson(JsonReader reader, Type objectType, object existingValue,        
  
   JsonSerializer serializer)
          {
              JToken token = JToken.Load(reader);
              return new ObjectId(token.ToObject&lt;string&gt;());
          }
  
          public override bool CanConvert(Type objectType)
          {
              return (objectType == typeof(ObjectId));
          }
        }
      }
  </code></pre>
  
  <p>I'm stuck I've tried half a dozen methods, I'm still getting the same error with json reader, any ideas anyone?  </p>
  
  <p>Last tried this from <a href="https://stackoverflow.com/questions/19097872/json-net-deserializing-mongo-objectid-is-giving-the-wrong-result">SO</a>*</p>
  
  <blockquote>
    <p>JsonReader Exception</p>
    
    <p>Unexpected character encountered while parsing value: O. Path '_id', line 1, position 10.</p>
  </blockquote>
  
  <p>The JSON string looks like this:</p>
  
  <pre><code>{
      "_id": ObjectId("5378f94a3513fa3374be7e20"),
      "cc": "GB",
      "userName": "xyz ",
      "userImage": "img/16.jpg",
      "createdDate": ISODate("2014-05-18T18:17:46.983Z"),
      "Headling": "Veniam, amet, incidunt veniam, ipsam nostrud natus exercitationem consectetur, eos dolorem. ",
      "subheading": "Veniam, amet, incidunt veniam, ipsam nostrud. "
  }
  </code></pre>