If I have a strongly typed data table with a column for values of type Int32
, and this column allows nulls, then I'll get an exception if I do this for a row where the value is null:
int value = row.CustomValue;
Instead I need to do this:
if (!row.IsCustomValueNull()) {
int value = row.CustomValue;
// do something with this value
}
Ideally I would like to be able to do this:
int? value = row.CustomValue;
Of course I could always write my own method, something like GetCustomValueOrNull
; but it'd be preferable if the property auto-generated for the column itself simply returned a nullable. Is this possible?