mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Log page now uses EF for faster runtime queries.
This commit is contained in:
parent
a984060533
commit
c6716f2425
49 changed files with 14898 additions and 555 deletions
26
NzbDrone.Core/Datastore/DbProviderFactory.cs
Normal file
26
NzbDrone.Core/Datastore/DbProviderFactory.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Data.Common;
|
||||
using System.Data.SqlServerCe;
|
||||
using MvcMiniProfiler;
|
||||
using MvcMiniProfiler.Data;
|
||||
|
||||
namespace NzbDrone.Core.Datastore
|
||||
{
|
||||
class DbProviderFactory : System.Data.Common.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;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue