Supose that exp.Row.IsdeliveryDateNull() returns True.
Having this code:
Dim theDate As Date?
If exp.Row.IsdeliveryDateNull() Then
theDate = Nothing
Else
theDate = exp.Row.deliveryDate
End If
' Result: theDate = Nothing
theDate = If(exp.Row.IsdeliveryDateNull(), Nothing, exp.Row.deliveryDate)
' Result: theDate = is #1/1/0001 12:00:00 AM# (Default value of Date)
Why does theDate gets different value depending on the type of if (normal or inline)?
I was expecting theDate = Nothing
in both ways.
Similar question I found: Why C# inline if result is different than if?