Skip to content

Commit b7ef191

Browse files
bkoelmandennisdoomen
authored andcommitted
Update AV1739 for discards (#90)
1 parent 153d1ab commit b7ef191

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Src/Guidelines/1700_NamingGuidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ Suppose you want to define events related to the deletion of an object. Avoid de
129129
It is good practice to prefix the method that handles an event with `On`. For example, a method that handles the `Closing` event can be named `OnClosing`.
130130

131131
### <a name="av1739"></a> Use an underscore for irrelevant lambda parameters (AV1739) ![](images/3.png)
132-
If you use a lambda statement, for instance, to subscribe to an event, and the actual parameters of the event are irrelevant, use the following convention to make that more explicit:
132+
If you use a lambda expression (for instance, to subscribe to an event) and the actual arguments of the event are irrelevant, use discards to make that explicit:
133133

134-
button.Click += (_, __) => HandleClick();
134+
button.Click += (_, _) => HandleClick();
135135

136136
### <a name="av1745"></a> Group extension methods in a class suffixed with Extensions (AV1745) ![](images/3.png)
137137
If the name of an extension method conflicts with another member or extension method, you must prefix the call with the class name. Having them in a dedicated class with the `Extensions` suffix improves readability.

0 commit comments

Comments
 (0)