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

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

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

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