How to create a type with several typical type parameters

I searched for some time and still could not find the answer to my question, instead I find the answers to "Creating a universal method with several parameters of a general type".

So this is my problem. I have an interface IMyInterface<T1, T2>and I want to create it as a Type. Currently, I can create a type for IMyInterface<T>as follows:

Type type = typeof(IMyInterface<>).MakeGenericType(genericTypeForMyInterface) 

Any help would be greatly appreciated.

Thank:)

+4
source share
1 answer

MakeGenericType params [] as , . , .

,

Type type = typeof(IMyInterface<,>).MakeGenericType(type1, type2);

, (,) angular . n-1 (n). .. , .

+5

All Articles