You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
5
5
severity: 2
6
6
---
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