码迷,mamicode.com
首页 > 其他好文 > 详细

反射IsGenericType

时间:2014-12-16 11:25:35      阅读:418      评论:0      收藏:0      [点我收藏+]

标签:ar   io   sp   on   ad   ef   amp   as   tt   

var propertyType = propertyInfo.PropertyType;

if (propertyType.IsGenericType &&
        propertyType.GetGenericTypeDefinition() == typeof(Nullable<>))
    {
      propertyType = propertyType.GetGenericArguments()[0];
    }

model.ModelProperties.Add(new KeyValuePair<Type, string>
                        (propertyType.Name,propertyInfo.Name));

反射IsGenericType

标签:ar   io   sp   on   ad   ef   amp   as   tt   

原文地址:http://www.cnblogs.com/zwei1121/p/4166490.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!