Setup used:
- Azure devops cloud hosted code
- Azure devops cloud hosted agents
- Sonarcloud buildtasks using azure devops cloud pipeline (classic pipeline)
- Rule: csharpsquid:S3216
During analysis of a C# project dotnet core 3.1 in azure devops using sonarcloud build steps we on do get analysis comments during PR’s but this ConfigureAwait(false) rule seem to not trigger.
Here is the new code which was analyse and to my knowledge it should add in configureawait on all 3 implementations?
public async Task<SmsEnterpriseDto> GetEnterpriseDetailsAsync(Guid enterpriseUuid)
{
var enterprise = await SmsHubRepository.GetByIdAsync(enterpriseUuid.ToString());
return enterprise == null || enterprise.Id == default ? null : Mapper.Map<SmsEnterpriseDto>(enterprise);
}
public async Task<CrudResult> UpdateEnterpriseAsync(SmsEnterpriseDto enterpriseDto)
{
if (enterpriseDto == null)
return CrudResult.NoEntity;
var enterprise = await SmsHubRepository.GetByIdAsync(enterpriseDto.Id.ToString());
if (enterprise != null && enterprise.Id != default )
{
return await SmsHubRepository.UpdateAsync(enterprise);
}
return CrudResult.NoEntity;
}