You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
718 B
28 lines
718 B
using System;
|
|
using System.Data.Common;
|
|
using System.Data.SqlServerCe;
|
|
using Db4objects.Db4o.Internal.Config;
|
|
using StackExchange.Profiling;
|
|
using StackExchange.Profiling.Data;
|
|
|
|
namespace NzbDrone.Core.Datastore
|
|
{
|
|
class DbProviderFactory : System.Data.Common.DbProviderFactory
|
|
{
|
|
public Boolean IsProfiled { get; set; }
|
|
|
|
public override DbConnection CreateConnection()
|
|
{
|
|
var sqliteConnection = new SqlCeConnection();
|
|
DbConnection connection = sqliteConnection;
|
|
|
|
if (IsProfiled)
|
|
{
|
|
connection = new ProfiledDbConnection(sqliteConnection, MiniProfiler.Current);
|
|
}
|
|
|
|
return connection;
|
|
}
|
|
}
|
|
}
|