diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index eb52e8be..926202ef 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -19,7 +19,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/Jube.Data/Reporting/Postgres.cs b/Jube.Data/Reporting/Postgres.cs index 8d39407c..3fc3c15f 100644 --- a/Jube.Data/Reporting/Postgres.cs +++ b/Jube.Data/Reporting/Postgres.cs @@ -84,12 +84,17 @@ public async Task PrepareAsync(string sql, List parameters) { await connection.OpenAsync(); - var command = new NpgsqlCommand(sql); + var command = new NpgsqlCommand(); command.Connection = connection; for (var i = 0; i < parameters.Count; i++) - command.Parameters.AddWithValue("@" + (i + 1), parameters[i]); + { + var paramName = "@param" + (i + 1); + sql = sql.Replace("@" + (i + 1), paramName); + command.Parameters.AddWithValue(paramName, parameters[i]); + } + command.CommandText = sql; await command.PrepareAsync(); } catch