public async Task Execute() { string query; ParametersContainer parameters; if (IsEmpty) { return; } _combinedRawQuery.Render(out query, out parameters); Console.WriteLine(query); await _connectionCreator(async (connection, transaction) => { using var cmd = new NpgsqlCommand(query, connection, transaction); parameters.AssignToCommand(cmd); using var reader = await cmd.ExecuteReaderAsync(); foreach (var operation in _resultProcessors) { await operation(reader); } await reader.CloseAsync(); }); }
public static void AssertRawQuery(RawQuery rq, string expectedQuery, params Param[] parameters) { if (expectedQuery == null) { throw new ArgumentNullException(nameof(expectedQuery)); } string query; ParametersContainer outParameters; rq.SkipExplicitColumnTableNames(); rq.Render(out query, out outParameters);