In c# Nullable.GetUnderlyingType(type)will return null if the type is not Nullable<T>. For some reason this is not what I expected.