Aller au contenu

Async suffix (ARCH003)

Ce contenu n’est pas encore disponible dans votre langue.

Key dotnet.naming.async-suffix · Severity info · Category naming

Async method names should end with the Async suffix. This lets callers immediately recognize that the method is awaitable.

public async Task<Order> GetOrder(int id)
{
return await _repository.FindAsync(id);
}
public async Task<Order> GetOrderAsync(int id)
{
return await _repository.FindAsync(id);
}

Add the Async suffix to the async method. If needed, suppress the rule per project/workspace via except/ignore.