示例#1
0
 public static MethodInfo GetNullableHasValueMethod(this Type type)
 {
     type = type.GetNonNullableType();
     return(NullableHasValueMethods.GetOrAdd(type, key =>
                                             NullableType.MakeGenericType(key).GetProperty("HasValue").GetGetMethod()));
 }
示例#2
0
文件: Cast.cs 项目: xia7410/dlr
        private static object NewNullableInstanceSlow(Type type)
        {
            Type concrete = NullableType.MakeGenericType(type);

            return(Activator.CreateInstance(concrete));
        }