Dapper async hangs

352 Views Asked by At

I updated Mysql.Data to use new mysql 8.* and since this update queryAsync hangs forever.

Here is my method:

public async Task<bool> IsLiveResultsEnabled(Guid clientId)
{          
    using (var connection = new MySqlConnection(_connectionString))
    {
        connection.Open();

        var result = await connection.QueryAsync<bool>(
            @"SELECT someField FROM someTable WHERE Id = @clientId",
            new
            {
                clientId
            });

        var resultValue = result.FirstOrDefault();

        return resultValue;
    }
}

when debugging code hangs on this line await connection.QueryAsync<bool>

So I tried to debug this method in dapper and it hangs on last line of the function enter image description here

After this line when I try to step to the next line it hangs.

Here is the call of IsLiveResultsEnabled:

private bool IsGapLiveSyncEnabled(Guid clientId)
{
    return _clientsService
        .IsLiveResultsEnabled(clientId)
        .GetAwaiter()
        .GetResult();
}

I also tried to use

_clientsService
    .IsLiveResultsEnabled(clientId)
    .ConfigureAwait(false)
    .GetAwaiter()
    .GetResult();

The result is the same.

0

There are 0 best solutions below