title: LinqToObject query Unable to cast object of type
body: <p>Why is this query not working</p>
  
  <pre><code>Private mapOverlays As New List(Of GMapOverlay)
  
  Dim mapOverlay = mapOverlays.Where(Function(x) x.Id = overlay.Name).Distinct()
  DirectCast(mapOverlay,GMapOverlay).IsVisibile = False
  </code></pre>
  
  <p>I am getting the error</p>
  
  <blockquote>
    <p>Unable to cast object of type
    'd__7a`1[GMap.NET.WindowsForms.GMapOverlay]' to type
    'GMap.NET.WindowsForms.GMapOverlay'.</p>
  </blockquote>