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

bool IsNullableType(Type theType)  
{  
    return (theType.IsGenericType && theType.  
      GetGenericTypeDefinition().Equals  
      (typeof(Nullable<>)));  
}  

it

相关文章
相关标签/搜索