public bool IsEmpty(object id)
{
if (id == null || ((BsonValue)id).IsBsonNull)
{
return true;
}
var idBsonBinaryData = (BsonBinaryData)id;
var subType = idBsonBinaryData.SubType;
if (subType != BsonBinarySubType.UuidLegacy && subType != BsonBinarySubType.UuidStandard)
{
throw new ArgumentOutOfRangeException("The binary sub type of the id value passed to the BsonBinaryDataGuidGenerator IsEmpty method is not UuidLegacy or UuidStandard.");
}
return idBsonBinaryData.Bytes.SequenceEqual(__emptyGuidBytes);
}
}