I have the following methods:
void Method(string param1, string param2);
void Method(string param1, object param2);
When I call the method using the following:
method("string", null);
It gives me an error because the call is ambiguous, the compiler does not know which version to call, because both methods accept null
as the second parameter.
How do I overcome this without changing the method name in one of them? the first method will never have null
.