Beispiel #1
0
        public static bool IsNullable(Type t)
        {
            ChecarSe.ArgumentoNaoNulo(t, nameof(t));

            if (t.IsValueType)
            {
                return(IsNullableType(t));
            }

            return(true);
        }
Beispiel #2
0
        public static bool IsNullableType(Type t)
        {
            ChecarSe.ArgumentoNaoNulo(t, nameof(t));

            return(t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable <>));
        }