I have this code at the moment:
Method1<Class1<Class2>>();
public void Method1<T>()
{
// process
}
Class1 needs a generic type itself (Class2).
I have to call the Method1 about 10 times for all of which Class2 would be the same type.
So how could I call Method1 with something like following:
Method1<Class1<J>>();
Where J is a generic type itself for the Class1.
You can use the
usingdirective in your class file to alias either one or both of your classes.(Apply appropriate namespaces as necessary to the class names, like
Foo.Bar.Class1, etc.)Now you can invoke your method with any of the following statements