当前位置:编程学习 > C#/ASP.NET >>

判断一个类型是否为可空类型(System.Nullable)

bool IsNullableType(Type theType)
{
    return (theType.IsGenericType && theType.
      GetGenericTypeDefinition().Equals
      (typeof(Nullable<>)));
}
补充:软件开发 , C# ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,