I'm trying to use the IIF in a simple mode:
Dim MyList As List(Of Double) = New List(Of Double)
Dim ret As Double
ret = IIf(MyList.Count > 0, MyList.Max(), 0)
There is no elements in MyList but a System.InvalidOperationException is thrown, "Sequence has no elements". Why IIF is evaluating the two sides ?
Thanks!