sonarr-repo-only/NzbDrone.Core/Datastore/PetaDbProviderFactory.cs

28 lines
659 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlServerCe;
using System.Text;
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 = ProfiledDbConnection.Get(sqliteConnection);
}
return connection;
}
}
}