Skip to content

Commit 6468583

Browse files
committed
Belgrade benchmark bug fix.
The used Map method is asynchronous, hence without waiting for operation to complete the benchmark is only counting the query invocation time.
1 parent abd625c commit 6468583

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

benchmarks/Dapper.Tests.Performance/Benchmarks.Belgrade.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Belgrade.SqlClient.SqlDb;
33
using Belgrade.SqlClient;
44
using System.ComponentModel;
5+
using System.Threading.Tasks;
56

67
namespace Dapper.Tests.Performance
78
{
@@ -18,11 +19,11 @@ public void Setup()
1819
}
1920

2021
[Benchmark(Description = "ExecuteReader")]
21-
public Post ExecuteReader()
22+
public async Task<Post> ExecuteReader()
2223
{
2324
Step();
2425
var post = new Post();
25-
_mapper.Sql("SELECT TOP 1 * FROM Posts WHERE Id = @Id").Param("Id", i).Map(
26+
await _mapper.Sql("SELECT TOP 1 * FROM Posts WHERE Id = @Id").Param("Id", i).Map(
2627
reader =>
2728
{
2829
post.Id = reader.GetInt32(0);

0 commit comments

Comments
 (0)