title: Vb.Net LINQ query nested list
body: <p>I have  list of cPoint objects. Every cPoint has list of cPosition objects.  I have to make query that returns only cPoints whose  cPositions meet the criteria and and every single cPoint must contain only those cPositions that meet the criteria.  Is it possible with LINQ?</p>
  
  <pre><code>'classes
  Public Class cPoint
      Private _PointName As String
      Public Positions As colPositions
      '...
  End Class
  
  Public Class cPosition
      Private _X As Double
      Private _Y As Double
      Private _Z As Double
      Private _IntervalStart As Long
      '...
  End Class
  
  Public Class cPoints
      Inherits System.ComponentModel.BindingList(Of cPoint)
  End Class
  
  Public Class cPositions
      Inherits System.ComponentModel.BindingList(Of cPosition)
  End Class
  </code></pre>
  
  <p>The closest thing I did is this query  but it does not return filtered cPoints. Every item in query has two objects: 1. filtered Point (with unfiltered child Positions) and 2. filtered Positions that belong to that Point.</p>
  
  <pre><code>Dim PtList As cPoints
  '...
  'my query 
  Dim query = (From pt In PtList
               From pos In pt.Positions
               Where (pos.IntervalStart &lt; 222)
               Select New With {Key .PT = pt,
               Key .PTPOS = (From position In pt.Positions Where (position.IntervalStart &lt; 222)).ToList}).Distinct
  </code></pre>