1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-20 00:11:46 +02:00
Radarr/NzbDrone.Core/Datastore/PetaDbProviderFactory.cs
Mark McDowall f8be43a486 Upgraded to MiniProfiler 1.9.
Updated to latest WebActivator.
2011-09-07 18:56:00 -07:00

29 lines
704 B
C#

using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlServerCe;
using System.Text;
using MvcMiniProfiler;
using MvcMiniProfiler.Data;
namespace NzbDrone.Core.Datastore
{
class PetaDbProviderFactory : 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;
}
}
}