添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
  • Linux
  • Nginx
  • 数据库
  • Python
  • PHP
  • C#
  • .NET
  • WPF
  • MAUI
  • Blazor
  • WinForm
  • 帝国CMS
  • AKCMS
  • Typecho
  • 织梦CMS
  • Visual Studio
  • Windows
  • Mac
  • Web前端
  • 数据采集
  • 运营
  • 产品
  • 摩托车
  • 电影
  • 杂事
  • /// <param name="type"></param> /// <returns></returns> public static bool IsList(this Type type) if (typeof(System.Collections.IList).IsAssignableFrom(type)) return true; foreach (var it in type.GetInterfaces()) if (it.IsGenericType && typeof(IList<>) == it.GetGenericTypeDefinition()) return true; return false; /// <summary> /// 判断类型是否为列表类型 /// </summary> /// <param name="type"></param> /// <returns></returns> public static bool IsEnumerable(this Type type) if (type.IsArray) return true; if (typeof(System.Collections.IEnumerable).IsAssignableFrom(type)) return true; foreach (var it in type.GetInterfaces()) if (it.IsGenericType && typeof(IEnumerable<>) == it.GetGenericTypeDefinition()) return true; return false; 本文作者:唐宋元明清 信息来源:cnblogs.com 唐宋元明清 所属分类: C# Power by Typecho. Theme by Puma. Written by 董川民- 独立开发者 渝ICP备16006207号-2 渝公网安备 50011202503233号

    友情链接: