Lamda Where

If cPadMain.PadHistoryList.Where(Function(h) h.IsNew = True).Count <> 0 Then
Dim cPadHistoryData As New PadHistoryData(Me.ConnectionStringSettings)
For Each ph As PadHistory In cPadMain.PadHistoryList.Where(Function(h) h.IsNew = True)
End If

Lamda Max

Dim dList As IList(Of Decision) = CType(DecisionBindingSource.DataSource, IList(Of Decision))
dNew.ID = dList.Max(Function(d) d.ID) + 1

Lamda check for repeats

Public Function IsSupplierPriorityOK() As Boolean
    'Lambda Check for repeats
    For Each cs1 As Costing.ComponentSupplier In Me.ComponentSupplierList.OrderBy(Function(h) h.Priority)
        Dim p1 As Integer = cs1.Priority
        If Me.ComponentSupplierList.Where(Function(h) h.Priority = p1).Count <> 1 Then
            Return False
        End If
    Return True
End Function

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: