mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 20:44:00 +02:00
Fixed petapoco's craptastic connection management.
This commit is contained in:
28
NzbDrone.Core/Datastore/PetaDbProviderFactory.cs
Normal file
28
NzbDrone.Core/Datastore/PetaDbProviderFactory.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlServerCe;
|
||||
using System.Linq;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user