public void SerializeProperty( BsonWriter bsonWriter, object obj, BsonPropertyMap propertyMap ) { var value = (BsonBinaryData) propertyMap.Getter(obj); if (value == null) { bsonWriter.WriteNull(propertyMap.ElementName); } else { bsonWriter.WriteBinaryData(propertyMap.ElementName, value.Bytes, value.SubType); } }
public void SerializeProperty( BsonWriter bsonWriter, object obj, BsonPropertyMap propertyMap ) { var value = (Guid) propertyMap.Getter(obj); bsonWriter.WriteBinaryData(propertyMap.ElementName, value.ToByteArray(), BsonBinarySubType.Uuid); }