Get Type of a nested Generic class in a Generic class in C#
|Added at||2017-01-02 12:01|
In my project I use the following class:
The Filter class filters objects of type T. The filter uses the IChecker list to check different fields in the class T in which U is the type of this field in T.
In some other method in a different class I want to create an instance of a checker. In that method the type of T is Transaction, which is know at compile time. The type of U is only known by a Type instance. The code below show how you would normally create an instance of generic class knowing the Type.
I want to take this a little bit further and do the following:
Is it possible get the type of a nested Generic class in a Generic class in C#?