I have this property:
int? firstClientID;
Why does this
firstClientID = dataRow.IsFirstClientIDNull()
? null
: (int.TryParse(dataRow.FirstClientID, out tempInt)
? tempInt
: 0);
not compile because
type of conditional statement cannot be determined since there is no implicit conversion between null and int
and does
if (dataRow.IsFirstClientIDNull())
firstClientID = null;
else if (int.TryParse(dataRow.FirstClientID, out tempInt))
firstClientID = tempInt;
else
firstClientID = 0;
work? They seem to do the same thing.