Fixed petapoco's craptastic connection management.

This commit is contained in:
kay.one 2011-08-28 10:43:33 -07:00
commit a5527df584
4 changed files with 47 additions and 27 deletions

View 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;
}
}
}