I have a function that accepts a parameter of type object which is an anonymous type generated elsewhere. I also have a generic class which I am trying to create an instance of using that anonymous type as the type passed to the generic class. But I am unable to get this to work.
So here is basically what I have for my generic class:
Class Foo(Of T)
Public Sub MyFunction(data As Object)
'data is an anonymous Type
dim item = new Foo(Of ??)
Public Sub MyFunction(Of T)(data As T) Dim item = New Foo(Of T)() End Sub