You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The line above generates a warning, `CS8123`, telling you that the names on the right
119
-
side of the assignment, `Alpha` and `Beta` are ignored because they conflict
119
+
side of the assignment, `Alpha` and `Beta`, are ignored because they conflict
120
120
with the names on the left side, `First` and `Second`.
121
121
122
122
The examples above show the basic syntax to declare tuples. Tuples are
123
123
most useful as return types for `private` and `internal` methods. Tuples
124
124
provide a simple syntax for those methods to return multiple discrete values:
125
125
You save the work of authoring a `class` or a `struct` that
126
-
defines the type returned. There is no need for creating a new type.
126
+
defines the type returned. There is no need to create a new type.
127
127
128
128
Creating a tuple is more efficient and more productive.
129
-
It is a simpler, lightweight syntax to define a data structure that carries
129
+
It has a simpler, lightweight syntax to define a data structure that carries
130
130
more than one value. The example method below returns the minimum and maximum
131
131
values found in a sequence of integers:
132
132
@@ -136,7 +136,7 @@ items:
136
136
137
137
* You save the work of authoring a `class` or a `struct` that defines the type returned.
138
138
* You do not need to create new type.
139
-
* The language enhancements removes the need to call the <xref:System.Tuple.Create``1(``0)> methods.
139
+
* The language enhancements removes the need to call the <xref:System.Tuple.Create``1(``0)?displayProperty=nameWithType> methods.
140
140
141
141
The declaration for the method provides the names for the fields of the
142
142
tuple that is returned. When you call the method, the return value is a
@@ -174,7 +174,7 @@ items:
174
174
- title: Use discards to select needed members
175
175
durationInMinutes: 2
176
176
content: |
177
-
Often when deconstructing a tuple or calling a method with `out` parameters, you're forced to define a variable whose value you don't care about and don't intend to use. C# adds support for *discards* to handle this scenario. A discard is a write-only variable whose name is `_` (the underscore character); you can assign all of the values that you intend to discard to the single variable. A discard is like an unassigned variable; apart from the assignment statement, the discard can't be used in code.
177
+
Often when deconstructing a tuple or calling a method with `out` parameters, you're forced to define a variable whose value you don't care about and don't intend to use. C# adds support for *discards* to handle this scenario. A discard is a write-only variable whose name is `_` (the underscore character); you can assign all of the values that you intend to discard to the single variable. A discard is like an unassigned variable; apart from the assignment, the discard can't be used in code.
178
178
179
179
Discards are supported in the following scenarios:
180
180
@@ -186,7 +186,7 @@ items:
186
186
187
187
* As a standalone identifier when you want to explicitly identify the value of an assignment as a discard.
188
188
189
-
The following example defines a `QueryCityDataForYears` method that returns a 6-tuple that contains a data for a city for two different years. The method call in the example is concerned only with the two population values returned by the method and so treats the remaining values in the tuple as discards when it deconstructs the tuple.
189
+
The following example defines a `QueryCityDataForYears` method that returns a 6-tuple that contains data for a city for two different years. The method call in the example is concerned only with the two population values returned by the method and so treats the remaining values in the tuple as discards when it deconstructs the tuple.
0 commit comments