mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-18 22:31:08 +08:00
78ed4b2077
One of several moves to make this something we can dev on all platforms and build on Actions for v3 onwards.
29 lines
710 B
C#
29 lines
710 B
C#
using BenchmarkDotNet.Attributes;
|
|
using Massive;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
|
|
namespace Dapper.Tests.Performance
|
|
{
|
|
[Description("Massive")]
|
|
public class MassiveBenchmarks : BenchmarkBase
|
|
{
|
|
private DynamicModel _model;
|
|
|
|
[GlobalSetup]
|
|
public void Setup()
|
|
{
|
|
BaseSetup();
|
|
RegisterSqlFactory();
|
|
_model = new DynamicModel(ConnectionString);
|
|
}
|
|
|
|
[Benchmark(Description = "Query (dynamic)")]
|
|
public dynamic QueryDynamic()
|
|
{
|
|
Step();
|
|
return _model.Query("select * from Posts where Id = @0", _connection, i).First();
|
|
}
|
|
}
|
|
}
|