Skip to content

Commit 5a10d39

Browse files
authored
Update AV1755: Only use Async or TaskAsync as a suffix when a method has both synchronous and asynchronous versions (#374)
1 parent 2b4abc7 commit 5a10d39

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

_rules/1755.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
rule_id: 1755
33
rule_category: naming-conventions
4-
title: Postfix asynchronous methods with `Async` or `TaskAsync`
4+
title: Only use `Async` or `TaskAsync` as a suffix when a method has both synchronous and asynchronous versions
55
severity: 2
66
---
7-
The general convention for methods and local functions that return `Task` or `Task<TResult>` is to postfix them with `Async`. But if such a method already exists, use `TaskAsync` instead.
7+
Only suffix a method or local function that returns `Task` or `Task<TResult>` with `Async` if there is also a synchronous variant of that method. If no synchronous variant exists, the `Async` suffix adds unnecessary noise. If both synchronous and asynchronous variants exist, use `Async` as the suffix. If a method suffixed with `Async` already exists, use `TaskAsync` instead.

0 commit comments

Comments
 (0)