' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
﻿Imports System
Imports System.Collections.Generic

Namespace E
    Public Class Data
        Public Property A() As Integer
            Get
                Return m_A
            End Get
            Set
                m_A = Value
            End Set
        End Property
        Private m_A As Integer
        Public Property B() As String
            Get
                Return m_B
            End Get
            Set
                m_B = Value
            End Set
        End Property
        Private m_B As String
    End Class
    Public Class Program
        Public Shared Sub Main(args As String())
            Dim lst As New List(Of Data)()
            lst.Add(New Data() With { .A = 123, .B = "ABC" })
            lst.Add(New Data() With { .A = 456, .B = "DEF" })
            Dim d123 As Data = lst.Find(Function(d) d.A = 123)
            Console.WriteLine(d123.B)
            Dim ddef As Data = lst.Find(Function(d) d.B = "DEF")
            Console.WriteLine(ddef.A)
        End Sub
    End Class
End Namespace
