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

            return(Activator.CreateInstance(concrete));
        }