1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 18:42:42 +01:00
Radarr/NzbDrone.Core/Datastore/DbProviderFactory.cs
2013-02-15 16:52:47 -08:00

27 lines
679 B
C#

using System;
using System.Data.Common;
using System.Data.SqlServerCe;
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;
}
}
}