Skip to content

Commit 88f90ec

Browse files
committed
Fix snippet links (dotnet#24354)
* Fix snippet links * Indent code snippet properly
1 parent b738618 commit 88f90ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/csharp/fundamentals/functional/deconstruct.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ There are three ways to deconstruct a tuple:
2525

2626
- You can explicitly declare the type of each field inside parentheses. The following example uses this approach to deconstruct the three-tuple returned by the `QueryCityData` method.
2727

28-
:::code language="csharp" source="./snippets/deconstructing-tuples/deconstruct-tuple2.cs" ID="Snippet1":::
28+
:::code language="csharp" source="./snippets/deconstructing-tuples/deconstruct-tuple2.cs" ID="Snippet1":::
2929

3030
- You can use the `var` keyword so that C# infers the type of each variable. You place the `var` keyword outside of the parentheses. The following example uses type inference when deconstructing the three-tuple returned by the `QueryCityData` method.
3131

@@ -60,11 +60,11 @@ The following example illustrates the use of tuples with discards. The `QueryCit
6060

6161
C# doesn't offer built-in support for deconstructing non-tuple types other than the [`record`](#record-types) and [DictionaryEntry](xref:System.Collections.DictionaryEntry.Deconstruct%2A) types. However, as the author of a class, a struct, or an interface, you can allow instances of the type to be deconstructed by implementing one or more `Deconstruct` methods. The method returns void, and each value to be deconstructed is indicated by an [out](../../language-reference/keywords/out-parameter-modifier.md) parameter in the method signature. For example, the following `Deconstruct` method of a `Person` class returns the first, middle, and last name:
6262

63-
:::code language="csharp" source="./snippets/deconstructing-tuples/deconstruct-tuple2.cs" ID="Snippet1":::
63+
:::code language="csharp" source="./snippets/deconstructing-tuples/deconstruct-class1.cs" ID="Snippet1":::
6464

6565
You can then deconstruct an instance of the `Person` class named `p` with an assignment like the following code:
6666

67-
:::code language="csharp" source="./snippets/deconstructing-tuples/deconstruct-tuple3.cs" ID="Snippet1":::
67+
:::code language="csharp" source="./snippets/deconstructing-tuples/deconstruct-class1.cs" ID="Snippet2":::
6868

6969
The following example overloads the `Deconstruct` method to return various combinations of properties of a `Person` object. Individual overloads return:
7070

0 commit comments

Comments
 (0)