private async Task<IEnumerable<InvocationState>> ConnectAndQuery(string sql, object parameters = null)
{
using (var connection = await Connect())
{
return (await connection.QueryAsync<InvocationState.InvocationRow>(
sql,
parameters,
commandType: CommandType.Text)).Select(r => new InvocationState(r));
}
}