Skip to content

Commit 5e29d2e

Browse files
author
Ruben Schmidmeister
authored
Merge branch 'master' into remove-glossary
2 parents 3b48ae4 + 2b78a1a commit 5e29d2e

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

documentation/src/basic-constructs.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,21 @@ return condition
6565
```
6666
*ternary operator*
6767

68-
## Expression-bodied members
68+
## Switch Expression
69+
70+
Prefer switch expressions over switch statements.
71+
72+
```csharp
73+
return animalKind switch
74+
{
75+
AnimalKind.Dog => "dog",
76+
AnimalKind.Cat => "cat",
77+
_ => throw new InvalidOperationException($"Unsupported animal kind {animalKind}"),
78+
};
79+
```
80+
*switch expression*
81+
82+
## Expression-bodied Members
6983

7084
Use the expression body syntax when a member returns a single expression.
7185
Move the arrow to the next line when the expression gets too long.

documentation/src/physical-structure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Each class should go into its own file with the same name
44

5-
Only one class should be in a file. This also applies to an Enumerations.
6-
Inner classes are allowed but discouraged and an obvious exception to this rule.
5+
Only one class should be in a file. This also applies to enumeration types (`enum`).
6+
Inner classes are allowed but discouraged.
77

88
## Each namespace should go into its own folder with the same name
99

0 commit comments

Comments
 (0)