public static bool IsOpenGeneric(this Type type) { var typeInfo = type.GetTypeInfo(); return typeInfo.IsGenericTypeDefinition || typeInfo.ContainsGenericParameters; }