Always Initialize Persistent Fields

Initializing strings and DateTime values in the constructor helps avoiding problems with databinding. NDO doesn't have any problems with uninitialized persistent fields. An uninitialized string and DateTime.MinValue are stored as DBNull values in the database and converted back to null respective DateTime.MinValue while reading an object.

Note that Datetime values are ValueTypes and will always be initialized by .NET with the value DateTime.MinValue.

Database usually allows you to save the value NULL to numeric columns. But since .NET initializes numbers with 0, numeric columns will always have valid values after an object is stored by NDO. If you need the distinction between 0 and NULL, use nullable types.

NDO supports the nullable<T> type, allowing assignment of null to numeric values. These null values will then be stored in and retrieved from the database. For most applications assignment of null to numeric values does not make much sense, but there are useful scenarios and you are free to use this feature there.