public Task <T> ExecuteAsync <T>(IAsyncCommand <T> command, CancellationToken cancellationToken = default) { if (command.RequiresTransaction && _transaction == null) { throw new Exception($"The command {command.GetType()} requires a transaction"); } return(Retry.DoAsync(() => command.ExecuteAsync(_connection, _transaction, cancellationToken), _retryOptions)); }
public Task <T> QueryAsync <T>(IAsyncQuery <T> query, CancellationToken cancellationToken = default) => Retry.DoAsync(() => query.ExecuteAsync(_connection, _transaction, cancellationToken), _retryOptions);