mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 18:42:42 +01:00
Playing around with db factories.
This commit is contained in:
parent
c6716f2425
commit
974dfa319b
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Configuration;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Data.EntityClient;
|
using System.Data.EntityClient;
|
||||||
using System.Data.SqlServerCe;
|
using System.Data.SqlServerCe;
|
||||||
@ -13,6 +14,17 @@ public class Connection
|
|||||||
{
|
{
|
||||||
private readonly EnviromentProvider _enviromentProvider;
|
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)
|
public Connection(EnviromentProvider enviromentProvider)
|
||||||
{
|
{
|
||||||
_enviromentProvider = enviromentProvider;
|
_enviromentProvider = enviromentProvider;
|
||||||
@ -21,6 +33,7 @@ public Connection(EnviromentProvider enviromentProvider)
|
|||||||
static Connection()
|
static Connection()
|
||||||
{
|
{
|
||||||
Database.Mapper = new CustomeMapper();
|
Database.Mapper = new CustomeMapper();
|
||||||
|
InitiFacotry();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String MainConnectionString
|
public String MainConnectionString
|
||||||
|
Loading…
Reference in New Issue
Block a user