mirror of
https://github.com/DapperLib/Dapper.git
synced 2026-10-18 14:27:47 +08:00
30 lines
787 B
C#
30 lines
787 B
C#
using System.ComponentModel;
|
|
using BenchmarkDotNet.Attributes;
|
|
using Dapper.Tests.Performance.Dashing;
|
|
using Dashing;
|
|
|
|
namespace Dapper.Tests.Performance
|
|
{
|
|
[Description("Dashing")]
|
|
public class DashingBenchmarks : BenchmarkBase
|
|
{
|
|
private ISession Session;
|
|
|
|
[GlobalSetup]
|
|
public void Setup()
|
|
{
|
|
BaseSetup();
|
|
var configuration = new DashingConfiguration();
|
|
var database = new SqlDatabase(configuration, ConnectionString);
|
|
Session = database.BeginTransactionLessSession(_connection);
|
|
}
|
|
|
|
[Benchmark(Description = "Get")]
|
|
public Dashing.Post Get()
|
|
{
|
|
Step();
|
|
return Session.Get<Dashing.Post>(i);
|
|
}
|
|
}
|
|
}
|