NullableTypes Class Library

NullableTypes Namespace

NullableTypes for .NET are a very reliable and efficient version of built-in value-types that can be Null. NullableTypes pass more than 800 differents test cases and have close-to-optimal efficiency as built-in value-types. They may be used every time you need to store a Null value in a .NET built-in value-type. NullableTypes let you write code like this:

        public sealed class Order{
            public int OrderID {get {/*...*/}}
            public int CustomerID {get {/*...*/}}
            public NullableDateTime RequestedDeliveryDate {get {/*...*/}}
            // remaining members elided for clarity
where RequestedDeliveryDate can be either NullableDateTime.Null or a valid DateTime value. The property RequestedDeliveryDate.IsNull tests if the date is Null, and when it is not Null the property RequestedDeliveryDate.Value returns a valid DateTime value.

Namespace hierarchy


NullableNullValueException The exception that is thrown when the Value property of a NullableTypes structure is set to null.
NullableTypeException The base exception class for the NullableTypes exceptions.


INullable All of the NullableTypes objects and structures implement the INullable interface, reflecting the fact that, unlike the corresponding system types, NullableTypes can legally contain the value Null.


NullableBoolean Represents a boolean value that is either True, False or Null.
NullableByte Represents a byte value that is either an 8-bit unsigned integer in the range of 0 through 255 or Null.
NullableDateTime Represents an instant in time, but unlike System.DateTime, provides a Null value. Part of NullableTypes project.
NullableDecimal Represents a Decimal that is either a decimal number value or Null.
NullableDouble Represents a Double value that is either a double-precision floating point number or Null. NullableDouble complies with the IEC 60559:1989 (IEEE 754) standard for binary floating-point arithmetic as Double.
NullableInt16 Represents an Int16 that is either a 16-bit signed integer or Null.
NullableInt32 Represents an Int32 that is either a 32-bit signed integer or Null.
NullableInt64 Represents an Int64 that is either a 64-bit signed integer or Null.
NullableSingle Represents a Single value that is either a single-precision floating point number or Null. NullableSingle complies with the IEC 60559:1989 (IEEE 754) standard for binary floating-point arithmetic as Single.
NullableString Represents a String that is either a variable-length stream of characters or Null.


TypeCode Specifies the type of a NullableTypes structure.