|
|
@ -2,8 +2,6 @@
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Configuration;
|
|
|
|
using System.Configuration;
|
|
|
|
using System.Data.Common;
|
|
|
|
using System.Data.Common;
|
|
|
|
using System.Data.OleDb;
|
|
|
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
|
|
|
using System.Reflection;
|
|
|
|
using System.Reflection;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
|
using NzbDrone.Common;
|
|
|
|
using NzbDrone.Common;
|
|
|
@ -21,22 +19,16 @@ namespace NzbDrone.Core.Datastore
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Database.Mapper = new CustomeMapper();
|
|
|
|
Database.Mapper = new CustomeMapper();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (EnvironmentProvider.IsMono) return;
|
|
|
|
#if __MonoCS__
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var dataSet = (System.Data.DataSet)ConfigurationManager.GetSection("system.data");
|
|
|
|
var dataSet = (System.Data.DataSet)ConfigurationManager.GetSection("system.data");
|
|
|
|
dataSet.Tables[0].Rows.Add("Microsoft SQL Server Compact Data Provider 4.0"
|
|
|
|
dataSet.Tables[0].Rows.Add("Microsoft SQL Server Compact Data Provider 4.0"
|
|
|
|
, "System.Data.SqlServerCe.4.0"
|
|
|
|
, "System.Data.SqlServerCe.4.0"
|
|
|
|
, ".NET Framework Data Provider for Microsoft SQL Server Compact"
|
|
|
|
, ".NET Framework Data Provider for Microsoft SQL Server Compact"
|
|
|
|
, "System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91");
|
|
|
|
,
|
|
|
|
|
|
|
|
"System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91");
|
|
|
|
var proxyType = Assembly.Load("NzbDrone.SqlCe").GetExportedTypes()[0];
|
|
|
|
|
|
|
|
var instance = Activator.CreateInstance(proxyType);
|
|
|
|
|
|
|
|
var factoryMethod = proxyType.GetMethod("GetSqlCeProviderFactory");
|
|
|
|
|
|
|
|
_factory = (DbProviderFactory)factoryMethod.Invoke(instance, null);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_factory = SqlCeProxy.GetSqlCeProviderFactory();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -83,9 +75,10 @@ namespace NzbDrone.Core.Datastore
|
|
|
|
|
|
|
|
|
|
|
|
public static IDatabase GetPetaPocoDb(string connectionString, Boolean profiled = true)
|
|
|
|
public static IDatabase GetPetaPocoDb(string connectionString, Boolean profiled = true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if __MonoCS__
|
|
|
|
if (EnvironmentProvider.IsMono)
|
|
|
|
throw new NotSupportedException("SqlCe is not supported in mono");
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
throw new NotSupportedException("SqlCe is not supported in mono");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lock (initilized)
|
|
|
|
lock (initilized)
|
|
|
|
{
|
|
|
|
{
|
|
|
|