List<>泛类型基础参数类属性反射

            // Object拆箱,取List类型
            Type tp = DataSource.GetType();
            // 判断类型是否是List<>泛类型
            if (tp.IsGenericType && typeof(System.Collections.Generic.List<>).IsAssignableFrom(tp.GetGenericTypeDefinition()))
            {
                // 取基础参数类型
                Type type = tp.GenericTypeArguments[0];
                // 取基础类型的公共属性列表
                foreach (System.Reflection.PropertyInfo pi in type.GetProperties())
                {

                }
            }
        }
原文地址:https://www.cnblogs.com/honk/p/13354372.html