How do i check if a Type is a nullable enum in C# something like
Type t = GetMyType(); bool isEnum = t.IsEnum; //Type member bool isNullableEnum = t.IsNullab
public static bool IsNullable(this Type type) { return type.IsClass || (type.IsGeneric && type.GetGenericTypeDefinition == typeof(Nullable<>)); }
I left out the IsEnum check you already made, as that makes this method more general.
IsEnum