We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bd75550 + 6b8fbc8 commit 76a8139Copy full SHA for 76a8139
documentation/src/basic-constructs.md
@@ -65,7 +65,7 @@ return condition
65
```
66
*ternary operator*
67
68
-## switch expression
+## Switch Expression
69
70
Prefer switch expressions over switch statements.
71
@@ -79,6 +79,19 @@ return animalKind switch
79
80
*switch expression*
81
82
+## Expression-bodied Members
83
+
84
+Use the expression body syntax when a member returns a single expression.
85
+Move the arrow to the next line when the expression gets too long.
86
87
+```csharp
88
+public int Length => 0;
89
90
+public string AbsolutePath()
91
+ => Path.Combine(CalculateRootPath(), RelativePath);
92
+```
93
+*expression-bodied members*
94
95
## For-loops
96
97
Avoid for-loops and use LINQ and higher order functions as an alternative.
0 commit comments