Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion concepts/named-arguments/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ErikSchierboom"
],
"contributors": [
"yzAlvin"
"yzAlvin",
"yrahcaz7"
]
}
6 changes: 3 additions & 3 deletions concepts/named-arguments/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class Card
}

Card.NewYear(); // => "Happy 2020 from me!"
Card.Card(1999); // => "Happy 1999 from me!"
Card.Card(sender: "mom"); // => "Happy 2020 from mom!"
Card.NewYear(1999); // => "Happy 1999 from me!"
Card.NewYear(sender: "mom"); // => "Happy 2020 from mom!"
```

[named-arguments]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#named-arguments
[named-arguments]: https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/named-and-optional-arguments#named-arguments
4 changes: 3 additions & 1 deletion concepts/named-arguments/introduction.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Introduction

So far we have seen that the arguments passed into a method are matched to the method's declared parameters based on position. An alternative approach, particularly where a routine takes a large number of arguments, the caller can match arguments by specifying the declared parameter's identifier.
So far we have seen that the arguments passed into a method are matched to the method's declared parameters based on position.
An alternative approach is for the caller to match arguments by specifying the declared parameter's identifier.
This is particularly useful where a routine takes a large number of arguments.

The following illustrates the syntax:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ The compiler will automatically infer which overloaded method to call based on t

## Named Arguments

So far we have seen that the arguments passed into a method are matched to the method's declared parameters based on position. An alternative approach, particularly where a routine takes a large number of arguments, the caller can match arguments by specifying the declared parameter's identifier.
So far we have seen that the arguments passed into a method are matched to the method's declared parameters based on position.
An alternative approach is for the caller to match arguments by specifying the declared parameter's identifier.
This is particularly useful where a routine takes a large number of arguments.

The following illustrates the syntax:

Expand Down
Loading