private static bool IsUnsupportedType(Type type)
{
foreach (var unsupportedType in _unsupportedTypes)
{
if (unsupportedType.IsGenericTypeDefinition && type.IsGenericType)
{
var typeDefinition = type.GetGenericTypeDefinition();
if (typeDefinition == unsupportedType)
{
return true;
}
}
else if (type == unsupportedType)
{
return true;
}
}
return false;
}