LinQ wrapper to get distinct items from a IEnumerable based on a function of item
That is a good definition for an IQueryable but I believe it is better to implement the operation directly for an IEnumerable (note: I don't use VB, so translated from C#):

&lt;Extension()&gt; Public Iterator Function DistinctBy(Of T, TKey)(src As IEnumerable(Of T), keyFun As Func(Of T, TKey)) As IEnumerable(Of T)
    Dim seenKeys As New HashSet(Of TKey)()
    For Each e As T In src
        If seenKeys.Add(keyFun(e)) Then
            Yield e
        End If
    Next
End Function