Generate Generic Type At Runtime
问题 I am wondering if it is possible to use the type of one variable to set as the type of another generic variable? For example, say I have this code: public class Foo: IBar<ushort> { public FooBar() { Value = 0; } public ushort Value { get; private set; } } I also have this class: public class FooDTO<TType> : IBar<TType> { public TType Value { get; private set; } } In these examples, in the interface for IBar has the property TType Value; Then in my code I have this var myFoo = new Foo(); var