Ir al contenido

Async suffix (ARCH003)

Esta página aún no está disponible en tu idioma.

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.