/*******************************************/ /**** Public Methods ****/ /*******************************************/ public static BsonDocument ToBson(this object obj) { RegisterTypes(); if (obj is string) { BsonDocument document; BsonDocument.TryParse(obj as string, out document); return(document); } else { BsonDocument document = obj.ToBsonDocument(); if (document != null) { document.AddVersion(); } return(document); } }