mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-29 13:19:20 +08:00
23 lines
540 B
C#
23 lines
540 B
C#
using BenchmarkDotNet.Attributes;
|
|
|
|
namespace Dapper.Tests.Performance
|
|
{
|
|
public class SomaBenchmarks : BenchmarkBase
|
|
{
|
|
private dynamic _sdb;
|
|
|
|
[GlobalSetup]
|
|
public void Setup()
|
|
{
|
|
BaseSetup();
|
|
_sdb = Simple.Data.Database.OpenConnection(ConnectionString);
|
|
}
|
|
|
|
[Benchmark(Description = "FindById")]
|
|
public dynamic QueryDynamic()
|
|
{
|
|
Step();
|
|
return _sdb.Posts.FindById(i).FirstOrDefault();
|
|
}
|
|
}
|
|
} |