public override void Serialize(
BsonWriter bsonWriter,
Type nominalType,
object value,
IBsonSerializationOptions options)
{
if (nominalType != typeof(Image))
{
var message = string.Format("Nominal type must be Image, not {0}.", nominalType.FullName);
throw new ArgumentException(message, "nominalType");
}
if (value == null)
{
bsonWriter.WriteNull();
}
else
{
var message = string.Format("Value must be null.");
throw new ArgumentException(message, "value");
}
}
}