i have a sub with this signature
Public Sub Save(ByVal obj As IPta)
now i want the create a instance of Generic.PtaDao(of T) with the type of obj, which could be anything that inherits from my base class Pta
how can i do that? i already found a c# example http://stackoverflow.com/questions/307984/declare-a-generic-type-instance-dynamically
but i dont understand how to implement this in my case.
tia
-edit-
to clearify
lets pretend obj is a object of type Address (Address inherits from Pta so it implements IPta)
now i want to create a new PtaDao object that takes Address objects for example
Dim AddressDao as New Generic.PtaDao(of Address)
but i want to do this dynamically so if obj is of type UserGroup it should create a PtaDao(of UserGroup)