Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<PackageVersion Include="FirebirdSql.Data.FirebirdClient" Version="10.3.4" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="Iesi.Collections" Version="4.1.1" />
<PackageVersion Include="linq2db.SqlServer" Version="5.4.1.9" />
<PackageVersion Include="linq2db" Version="6.2.1" />
<PackageVersion Include="linq2db.SqlServer" Version="6.2.1" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.4" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="10.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.2" />
Expand Down
10 changes: 7 additions & 3 deletions benchmarks/Dapper.Tests.Performance/Benchmarks.Linq2DB.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
using BenchmarkDotNet.Attributes;

using System;
using System.ComponentModel;
using System.Linq;
using Dapper.Tests.Performance.Linq2Db;
using LinqToDB;
using LinqToDB.Data;
using System.ComponentModel;
using LinqToDB.DataProvider.SqlServer;

namespace Dapper.Tests.Performance
{
[Description("LINQ to DB")]
public class LinqToDBBenchmarks : BenchmarkBase // note To not 2 because the "2" confuses BDN CLI
{
private Linq2DBContext _dbContext;
private DataOptions _dataOptions;

private static readonly Func<Linq2DBContext, int, Post> compiledQuery = CompiledQuery.Compile((Linq2DBContext db, int id) => db.Posts.First(c => c.Id == id));

[GlobalSetup]
public void Setup()
{
BaseSetup();
DataConnection.DefaultSettings = new Linq2DBSettings(_connection.ConnectionString);
_dbContext = new Linq2DBContext();
// Use DataOptions builder pattern (recommended approach in linq2db v6)
_dataOptions = new DataOptions()
.UseSqlServer(_connection.ConnectionString);
_dbContext = new Linq2DBContext(_dataOptions);
}

[Benchmark(Description = "First")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<PackageReference Include="DevExpress.Xpo" />
<PackageReference Include="EntityFramework" VersionOverride="6.5.1" />
<PackageReference Include="FirebirdSql.Data.FirebirdClient" />
<PackageReference Include="linq2db" />
<PackageReference Include="linq2db.SqlServer" />
<PackageReference Include="MySqlConnector" />
<PackageReference Include="NHibernate" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
using LinqToDB;
using LinqToDB.Data;

namespace Dapper.Tests.Performance.Linq2Db
{
public class Linq2DBContext : LinqToDB.Data.DataConnection
public class Linq2DBContext : DataConnection
{
public Linq2DBContext(DataOptions options) : base(options)
{
}

public ITable<Post> Posts => this.GetTable<Post>();
}
}
34 changes: 0 additions & 34 deletions benchmarks/Dapper.Tests.Performance/Linq2DB/Linq2DbSettings.cs

This file was deleted.