An asynchronous method makes use of a blocking method, although there exists an asynchronous counterpart.
Replace the blocking method with its asynchronous counterpart.
The methods AddAsync
and AddRangeAsync
of entity framework's DbSet
and DbContext
are explicitely excluded from this analysis by default. The documentation recommends using the non-async versions instead.
# A white-space separated list of methods to exclude when searching for async counterparts
# Format: <type-specifier>:<method1>,<method2>
dotnet_diagnostic.PH_S019.exclusions = Microsoft.EntityFrameworkCore.DbContext:Add,AddRange Microsoft.EntityFrameworkCore.DbSet`1:Add,AddRange
# Only report async methods that have a compatible return type: match (default) / ignore
dotnet_diagnostic.PH_S019.returnType = match
# Only report async methods where the first N parameters match: any number (1=default)
dotnet_diagnostic.PH_S019.parameterTypeMatchCount = 1