Nullable type is not a nullable type?

According to the MSDN :

Calling GetType on a Nullable type
causes a boxing operation to be
performed when the type is implicitly
converted to Object. Therefore GetType
always returns a Type object that
represents the underlying type, not
the Nullable type.

When you box a nullable object, only the underlying type is boxed.

Again, from MSDN :

Boxing a non-null nullable value type
boxes the value type itself, not the
System.Nullable that wraps the value
type.

Leave a Comment