public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var bsonType = bsonReader.PeekBsonType();
     BsonArray value;
     if (bsonType == BsonType.Null) {
         bsonReader.ReadNull(propertyMap.ElementName);
         value = null;
     } else {
         bsonReader.ReadArrayName(propertyMap.ElementName);
         value = BsonArray.ReadFrom(bsonReader);
     }
     propertyMap.Setter(obj, value);
 }
 public void DeserializeProperty(
     BsonReader bsonReader,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     BsonType bsonType = bsonReader.PeekBsonType();
     DateTimeOffset value;
     if (bsonType == BsonType.Array) {
         bsonReader.ReadArrayName(propertyMap.ElementName);
         bsonReader.ReadStartDocument();
         var dateTime = new DateTime(bsonReader.ReadInt64("0"));
         var offset = new TimeSpan(bsonReader.ReadInt64("1"));
         bsonReader.ReadEndDocument();
         value = new DateTimeOffset(dateTime, offset);
     } else if (bsonType == BsonType.Document) {
         bsonReader.ReadDocumentName(propertyMap.ElementName);
         bsonReader.ReadStartDocument();
         bsonReader.VerifyString("_t", typeof(DateTimeOffset).FullName);
         var dateTime = DateTime.Parse(bsonReader.ReadString("dt")); // Kind = DateTimeKind.Unspecified
         var offset = TimeSpan.Parse(bsonReader.ReadString("o"));
         bsonReader.ReadEndDocument();
         value = new DateTimeOffset(dateTime, offset);
     } else {
         throw new FileFormatException("Element is not valid System.DateTimeOffset");
     }
     propertyMap.Setter(obj, value);
 }