I am playing around with MongoDB and have an object with a mongodb ObjectId on it. When I serialise this with the .NET Json() method, all is good (but the dates are horrible
I ran into a similar problem with a Web API project, and wound up beating my head against the keyboard for a few hours before I found this thread.
Initially everything was working fine, but then I ran into the problem after converting my code to use my own custom class instead of the BsonDocument object as recommended in the mongoDB C# driver documentation.
http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-csharp-driver/#bsondocument-object-model-vs-your-own-domain-classes
Here the VB.net equivalent to the solution above for those that need it;
Public Class DocumentMetadata
_
_
Public Property Id() As String
Public Property Name() As String
Public Property FullName() As String
_
Public Property DownloadTime() As DateTime
End Class