how to deserialization The object “MongoDB.Bson.ObjectId”
https://github.com/JamesNK/Newtonsoft.Json/issues/2378
I use [Newtonsoft.Json]
public class WebConfig
{
[MongoDB.Bson.Serialization.Attributes.BsonElement("_id")]
public MongoDB.Bson.ObjectId MongoId { get; set; }
}
Newtonsoft.Json.JsonSerializationException:
“Error converting value “5f3facb172225d2400eed3f9” to type ‘MongoDB.Bson.ObjectId’. Path ‘MongoId’.”
pls help me
I have try it
MongoDB.Bson.Serialization.BsonSerializer.Deserialize<T>(Newtonsoft.Json.JsonConvert.SerializeObject(JObject));
But i failed…
Thanks