Skip to content

Commit 88cbbe3

Browse files
committed
fix snippet
1 parent 31ccae3 commit 88cbbe3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/csharp/tour-of-csharp/tutorials/tuples-and-types.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Tuples are easy to create, but they are limited in their capabilities. Tuple typ
4949

5050
Tuples are great for those times when you want multiple values in the same structure. They're lightweight, and can be declared as they are used. As your program goes, you might find that you use the same tuple type throughout your code. If your app does work in the 2D graph space, the tuples that represent points might be common. Once you find that, you can declare a `record` type that stores those values and provides more capabilities:
5151

52-
:::code language="csharp" interactive="try-dotnet-class" source="./snippets/TuplesAndTypes/PointEvolutions.cs" id="PointVersion2":::
52+
:::code language="csharp" interactive="try-dotnet-class" source="./snippets/TuplesAndTypes/PointEvolution.cs" id="PointVersion2":::
5353

5454
The preceding single line of code declares a named *record* type that stores the values `X` and `Y` in readonly properties. You use the name `Point` wherever you use that type. Using a named type makes it clear how the type is used. Unlike tuples, you can't change the value of a property in a record, but you can still make a new copy using a `with` expression. Record types can include behavior as well as data. In C#, any type declaration starts with `{` and ends with `}`. Replace the record declaration you made with the following:
5555

0 commit comments

Comments
 (0)