If I had a general class:
public class GenericTest<T> : IGenericTest {...}
and I had an instance of a type that I got through reflection, how can I create an instance of GenericType with this type? For instance:
public IGenericTest CreateGenericTestFromType(Type tClass) { return (IGenericTest)(new GenericTest<tClass>()); }
Of course, the above method will not compile, but it illustrates what I'm trying to do.
source share