I have a function that looks similar to the following. I'd like to modify it so I can pass in multiple types to filter on instead of just one. I don't suppose there's a params/paramarray option for type parameters, is there?
Public Shared Function Filter(Of T)()
Dim results As New List(Of T)
For Each item In GlobalCollection.All()
If GetType(T).IsAssignableFrom(item.GetType()) Then
results.Add(instance)
End If
Next
Return results.ToArray()
End Function
I'd like to be able to call it like:
Filter(Of Car)
and also like:
Filter(Of Car, Truck, Boat)