I have a class that currently has several methods that take integer parameters. These integers map to operations that the application can perform. I\'d like to make the clas
The compiler can infer the type arguments on methods most of the time based on the type of the arguments passed:
public void DoSomething(T test) {
}
can be called with
DoSomething(4); // = DoSomething(4);
DoSomething(MyEnum.SomeValue); // = DoSomething(MyEnum.SomeValue);
By the way, you can have non-generic overloads of a generic method too.