Skip to content

Instantly share code, notes, and snippets.

View Sandiejat's full-sized avatar

Sandeep Verma Sandiejat

View GitHub Profile
@Sandiejat
Sandiejat / BsonToDotnetMapping.cs
Last active May 16, 2020 22:57
Example to convert a BsonDocument to DotNet Object using MongoDB.Bson in C#
var bsonDoc = new BsonDocument
{
{"title", "My Title"},
{"datetime", DateTime.UtcNow},
{"number", 100},
{"some_decimal", 50.0}
};
var dotNetObj = BsonTypeMapper.MapToDotNetValue(bsonDoc);
JsonConvert.SerializeObject(dotNetObj);
.navbar
.caret
.label
.table
.img-responsive
.img-rounded
.img-thumbnail
.img-circle
.sr-only
.lead