Skip to content

Commit 0525de6

Browse files
committed
Pass parameter names explicitly when using Dapper
Fixes #2465
1 parent a9c697d commit 0525de6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/Hangfire.SqlServer/SqlServerConnection.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public override HashSet<string> GetAllItemsFromSet(string key)
389389

390390
var result = connection.Query<string>(
391391
query,
392-
new { key },
392+
new { key = key },
393393
commandTimeout: storage.CommandTimeout);
394394

395395
return new HashSet<string>(result);
@@ -414,7 +414,7 @@ public override List<string> GetFirstByLowestScoreFromSet(string key, double fro
414414

415415
var result = connection.Query<string>(
416416
query,
417-
new { count = pair.Value.Item3, pair.Key, from = pair.Value.Item1, to = pair.Value.Item2 },
417+
new { count = pair.Value.Item3, key = pair.Key, from = pair.Value.Item1, to = pair.Value.Item2 },
418418
commandTimeout: storage.CommandTimeout);
419419

420420
return result.ToList();
@@ -489,7 +489,7 @@ public override Dictionary<string, string> GetAllEntriesFromHash(string key)
489489

490490
var result = connection.Query<SqlHash>(
491491
query,
492-
new { key },
492+
new { key = key },
493493
commandTimeout: storage.CommandTimeout)
494494
.ToDictionary(static x => x.Field, static x => x.Value);
495495

0 commit comments

Comments
 (0)