Due cose carine sui Nullable Types che mi segno, in caso di utilizzi futuri.
Per verificare se un tipo è Nullable:
bool IsANullableType(Type type)
{
return (type.IsGenericType &&
type.GetGenericTypeDefinition().Equals(typeof(Nullable<>))
);
}
Per sapere il corrispondente “Non Nullable” di un Nullable Type:
NullableConverter nc = new NullableConverter(int?);
Type notNullableType = nc.UnderlyingType; // notNullableType è int