波斯马BOSSMA Information Technology

C# 判断是否为可空类型

发布时间:2012年12月2日 / 分类:DOTNET / 9,946 次浏览 / 评论

判断一个类型是否为可空类型。

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

转自:http://blog.csdn.net/lee576/article/details/6335190

本博客所有文章如无特别注明均为原创。
复制或转载请以超链接形式注明转自波斯马,原文地址《C# 判断是否为可空类型

建议订阅本站,及时阅读最新文章!
【上一篇】 【下一篇】

发表评论