判断一个类型是否为可空类型。
bool IsNullableType(Type theType) { return (theType.IsGenericType && theType. GetGenericTypeDefinition().Equals (typeof(Nullable<>))); }
发布时间:2012年12月2日 / 分类:DOTNET / 9,312 次浏览 / 评论
判断一个类型是否为可空类型。
bool IsNullableType(Type theType) { return (theType.IsGenericType && theType. GetGenericTypeDefinition().Equals (typeof(Nullable<>))); }
发表评论
相关文章
想了解服务发现、配置管理的同学,欢迎加入1000人Consul交流群:234939415
扫码关注公众号:萤火架构
文章分类
最新评论