mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-31 07:52:37 +01:00
27 lines
666 B
C#
27 lines
666 B
C#
using System;
|
|
using System.Data.Common;
|
|
using System.Data.SqlServerCe;
|
|
using MvcMiniProfiler;
|
|
using MvcMiniProfiler.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;
|
|
}
|
|
}
|
|
}
|