Commit 6aece653 authored by Chris Donnelly's avatar Chris Donnelly Committed by Nick Craver

MightyOrm needs a nonstandard connection string.

We are now providing it programmatically so we don't disrupt SQL Server.
parent 455b3f3b
...@@ -15,8 +15,13 @@ public class MightyBenchmarks : BenchmarkBase ...@@ -15,8 +15,13 @@ public class MightyBenchmarks : BenchmarkBase
public void Setup() public void Setup()
{ {
BaseSetup(); BaseSetup();
_model = new MightyOrm<Post>(ConnectionString);
_dynamicModel = new MightyOrm(ConnectionString); // Mighty needs the connection string to contain the ProviderName in addition to everything else for Reasons.
// However, it appears the SQL Server driver chokes on it if it's in the full connection string, so we programatically add it here.
var connectionString = $"{ConnectionStringSettings.ConnectionString};ProviderName={ConnectionStringSettings.ProviderName}";
_model = new MightyOrm<Post>(connectionString);
_dynamicModel = new MightyOrm(connectionString);
} }
[Benchmark(Description = "Query<T>")] [Benchmark(Description = "Query<T>")]
......
...@@ -11,7 +11,8 @@ public abstract class BenchmarkBase ...@@ -11,7 +11,8 @@ public abstract class BenchmarkBase
{ {
protected static readonly Random _rand = new Random(); protected static readonly Random _rand = new Random();
protected SqlConnection _connection; protected SqlConnection _connection;
public static string ConnectionString { get; } = ConfigurationManager.ConnectionStrings["Main"].ConnectionString; public static ConnectionStringSettings ConnectionStringSettings { get; } = ConfigurationManager.ConnectionStrings["Main"];
public static string ConnectionString { get; } = ConnectionStringSettings.ConnectionString;
protected int i; protected int i;
protected void BaseSetup() protected void BaseSetup()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment