Skip to content

Commit a00bc45

Browse files
author
Ruben Schmidmeister
authored
Add links to .NET docs
1 parent f9dd10a commit a00bc45

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

documentation/src/basic-constructs.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ return condition
7474

7575
## Switch Expression
7676

77-
Prefer switch expressions over switch statements.
77+
Prefer [switch expressions] over switch statements.
7878

7979
```csharp
8080
return animalKind switch
@@ -86,9 +86,11 @@ return animalKind switch
8686
```
8787
*switch expression*
8888

89+
[switch expressions]: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/switch-expression
90+
8991
## Expression-bodied Members
9092

91-
Use the expression body syntax when a member returns a single expression.
93+
Use the [expression body syntax] when a member returns a single expression.
9294
Move the arrow to the next line when the expression gets too long.
9395

9496
```csharp
@@ -99,6 +101,8 @@ public string AbsolutePath()
99101
```
100102
*expression-bodied members*
101103

104+
[expression body syntax]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/expression-bodied-members
105+
102106
## For-loops
103107

104108
Avoid for-loops and use LINQ and higher order functions as an alternative.
@@ -119,8 +123,10 @@ foreach (var value in values.OrderByDescending(v => v))
119123

120124
### Handle all cases
121125

122-
Unhandled cases lead the program into an undefined state. If you have no natural default case, declare one throwing a System.NotImplementedException.
126+
Unhandled cases lead the program into an undefined state. If you have no natural default case, declare one throwing a [System.NotImplementedException].
127+
128+
[System.NotImplementedException]: https://docs.microsoft.com/en-us/dotnet/api/system.notimplementedexception
123129
124130
## Goto
125131

126-
The goto statement is forbidden in all cases.
132+
The goto statement is forbidden in all cases.

0 commit comments

Comments
 (0)