I would expect the following vb.net function to return a value of Nothing
, but instead its returning a value of 0
...
Public Shared Function GetDefaultTipoSrvTkt() As Integer?
Dim tsrvDict As New Dictionary(Of Integer, DataRow)
GetDefaultTipoSrvTkt = If(IsNothing(tsrvDict) OrElse tsrvDict.Count = 0, Nothing, tsrvDict.First.Key)
End Function
The last line of the function could also be written as Return If(IsNothing(tsrvDict) OrElse tsrvDict.Count = 0, Nothing, tsrvDict.First.Key)
but in any case, why is the IF()
function If(IsNothing(tsrvDict) OrElse tsrvDict.Count = 0, Nothing, tsrvDict.First.Key)
returning 0
instead of Nothing
?