Named Arguments
We can use parameters names from the method signature in the method call as named arguments.
To take advantage of named arguments, simply add the parameter name and a colon before argument value.
But there are some eccentricities we need to keep in mind.
when using arguments, parameter order no longer matters, c# match the arguments by their names not by their by positional order.
Not all arguments need to be named, we can use named arguments for only those arguments that are less clear.
All name arguments must follow positional arguments.
To take advantage of named arguments, simply add the parameter name and a colon before argument value.
But there are some eccentricities we need to keep in mind.
when using arguments, parameter order no longer matters, c# match the arguments by their names not by their by positional order.
Not all arguments need to be named, we can use named arguments for only those arguments that are less clear.
All name arguments must follow positional arguments.
Comments
Post a Comment