public void SerializeProperty(
     BsonWriter bsonWriter,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var value = (bool) propertyMap.Getter(obj);
     bsonWriter.WriteBoolean(propertyMap.ElementName, value);
 }
 public void SerializeProperty(
     BsonWriter bsonWriter,
     object obj,
     BsonPropertyMap propertyMap
 )
 {
     var value = (BsonBoolean) propertyMap.Getter(obj);
     if (value == null) {
         bsonWriter.WriteNull(propertyMap.ElementName);
     } else {
         bsonWriter.WriteBoolean(propertyMap.ElementName, value.Value);
     }
 }