Let’s say I have the class
class SomeClass<T>
{
public static void someMethod(T param1) // this gives an error
// I have to do something like (var param1)
{
// ...
// ...
}
}
How could require param1 to be of type T so that I can call the method as:
SomeOtherClass object1 = new SomeOtherClass();
SomeClass<SomeOtherClass>.someMethod(object1);
1 Answer