【发布时间】:2016-04-25 11:28:07
【问题描述】:
我正在尝试以简单模式使用 IIF:
Dim MyList As List(Of Double) = New List(Of Double)
Dim ret As Double
ret = IIf(MyList.Count > 0, MyList.Max(), 0)
MyList 中没有元素,但抛出 System.InvalidOperationException,“序列没有元素”。 IIF 为什么要评估这两个方面?
谢谢!
【问题讨论】: