2011-08-28 20:43:33 +03:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Data.Common;
|
|
|
|
using System.Data.SqlServerCe;
|
|
|
|
using System.Text;
|
2011-09-08 04:56:00 +03:00
|
|
|
using MvcMiniProfiler;
|
2011-08-28 20:43:33 +03:00
|
|
|
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)
|
|
|
|
{
|
2011-09-08 04:56:00 +03:00
|
|
|
connection = new ProfiledDbConnection(sqliteConnection, MiniProfiler.Current);
|
2011-08-28 20:43:33 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return connection;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|