Playing around with db factories.

pull/3113/head
kay.one 13 years ago
parent c6716f2425
commit 974dfa319b

@ -1,4 +1,5 @@
using System;
using System.Configuration;
using System.Data.Common;
using System.Data.EntityClient;
using System.Data.SqlServerCe;
@ -13,6 +14,17 @@ namespace NzbDrone.Core.Datastore
{
private readonly EnviromentProvider _enviromentProvider;
public static void InitiFacotry()
{
var dataSet = ConfigurationManager.GetSection("system.data") as System.Data.DataSet;
dataSet.Tables[0].Rows.Add("Microsoft SQL Server Compact Data Provider 4.0"
, "System.Data.SqlServerCe.4.0"
, ".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");
}
public Connection(EnviromentProvider enviromentProvider)
{
_enviromentProvider = enviromentProvider;
@ -21,6 +33,7 @@ namespace NzbDrone.Core.Datastore
static Connection()
{
Database.Mapper = new CustomeMapper();
InitiFacotry();
}
public String MainConnectionString

Loading…
Cancel
Save