private bool IsNotSupported(Type type)
{
bool isUnsupportedType = (type == typeof(IList) ||
type == typeof(ISet) ||
type == typeof(IDictionary));
if( !isUnsupportedType && type.IsGenericType )
{
isUnsupportedType = (
typeof(System.Collections.Generic.ICollection<>).IsAssignableFrom(type.GetGenericTypeDefinition()) ||
typeof(System.Collections.Generic.IList<>).IsAssignableFrom(type.GetGenericTypeDefinition()) ||
typeof(System.Collections.Generic.IDictionary<,>).IsAssignableFrom(type.GetGenericTypeDefinition()));
}
return isUnsupportedType;
}
}