title: VB.NET Linq To Objects Intersect Returning Objects
body: <p>How do you get a collection of objects from an intersection of an object array and a string array?</p>
  
  <p>For example, I have a collection of objects (class Person), and a string array of names:</p>
  
  <pre><code>Public Class Person
      Public lastName As String
      Public firstName As String
  End Class
  
  Public Class Form1
      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
          Dim personArray As List(Of Person)
          Dim p1 As Person = New Person("Bill", "Fitch") : personArray.Add(p1)
          Dim p2 As Person = New Person("Randy", "Roberts") : personArray.Add(p2)
          Dim p3 As Person = New Person("Miles", "Johnson") : personArray.Add(p3)
          Dim p4 As Person = New Person("Sandy", "Smith") : personArray.Add(p4)
  
          Dim arrayNames() As String = {"Jones", "Roberts", "Smith", "Teague"}
  
          'The Linq code
          Dim query = From myPerson In personArray
                      Where myPerson.lastName = arrayNames
                      Select myPerson
      End Sub
  End Class
  </code></pre>
  
  <p>Of course the Linq code does not work but what Linq does?</p>