using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
static void Main(string[] args)
var mapper = new BsonMapper();
mapper.RegisterType<DateTime>(
value => value.ToString("o", CultureInfo.InvariantCulture),
bson => DateTime.ParseExact(bson, "o", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind));
using (var db = new LiteDatabase("instance.db", mapper) { UtcDate = true })
var expected = new Foo(new DateTime(637310234309996491, DateTimeKind.Utc));
var col = db.GetCollection<Foo>();
var actual = col.FindAll().First();
public Foo(DateTime value)
public DateTime Value { get; }