1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-30 11:35:35 +00:00
Lidarr/NzbDrone.Core/Datastore/PetaDbProviderFactory.cs

29 lines
704 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;
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;
}
}
}