Handling MongoDB's ISODate() when attempting to parse a serialized JSON string

前端 未结 6 1894
庸人自扰
庸人自扰 2021-02-07 11:00

I\'m using MongoDB via the official C# driver with an ASP.NET MVC web site.

I have the following C# model:

public class Contact
{
    public ObjectId Id          


        
6条回答
  •  逝去的感伤
    2021-02-07 11:27

    I think you need to tweak your JSON serializer a bit more. Try this:

    var jsonWriterSettings = new JsonWriterSettings { OutputMode = JsonOutputMode.Strict };
    Console.WriteLine(document.ToJson(jsonWriterSettings));
    

提交回复
热议问题