6
我在使用MAX lambda表達式的vb equivilant時遇到了問題。在foos.Max(函數(X)x.id)當我嘗試智能感知屬性ID VS不會表現出來。但是,當我運行該示例它的作品。我在做什麼是錯的,我只是幸運而已?vb lambda MAX函數
Sub Main()
Dim foos As New List(Of Foo)
Dim bob As New Foo() With {.id = 5, .name = "bob"}
foos.Add(bob)
foos.Max(Function(x) x.id)
End Sub
Public Class Foo
Public Property id() As Integer
Get
Return m_id
End Get
Set(ByVal value As Integer)
m_id = Value
End Set
End Property
Private m_id As Integer
Public Property name() As String
Get
Return m_name
End Get
Set(ByVal value As String)
m_name = Value
End Set
End Property
Private m_name As String
End Class