How does one get the type of a generic class with multiple type parameters? - C#

Viewed 1989

This compiles:

public class A<T> {
    public void test() {
        var a = typeof (A<>);
    }
}

This does not:

public class A<T,S> {
    public void test() {
        var a = typeof (A<>);
    }
}

I get the error: Using the generic type 'A' requires 2 type arguments

How do I get a reference to the type of this generic type with two arguments?

2 Answers
Related