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 b49a61b + 6b8fbc8 commit 3b48ae4Copy full SHA for 3b48ae4
documentation/src/basic-constructs.md
@@ -65,6 +65,19 @@ return condition
65
```
66
*ternary operator*
67
68
+## Expression-bodied members
69
+
70
+Use the expression body syntax when a member returns a single expression.
71
+Move the arrow to the next line when the expression gets too long.
72
73
+```csharp
74
+public int Length => 0;
75
76
+public string AbsolutePath()
77
+ => Path.Combine(CalculateRootPath(), RelativePath);
78
+```
79
+*expression-bodied members*
80
81
## For-loops
82
83
Avoid for-loops and use LINQ and higher order functions as an alternative.
0 commit comments