private void VerifyNominalType(Type nominalType)
{
if (!(nominalType.IsClass || (nominalType.IsValueType && !nominalType.IsPrimitive) || nominalType.IsInterface) ||
typeof(Array).IsAssignableFrom(nominalType))
{
string message = string.Format("BsonClassMapSerializer cannot be used with type {0}.", nominalType.FullName);
throw new BsonSerializationException(message);
}
}