I have a method that takes three optional parameters.
public int DoStuff(int? count = null, bool? isValid = null, string name = "default")
{
}
My question is: if I call this method and pass one argument to the method:
var isValid = true;
DoStuff(isValid);
I get the following error:
Argument 1: cannot convert from 'bool' to 'int?'
Is it possible to pass one argument to a method and indicate which parameter I want to specify?
source
share