blob: f6fcbcf3fdd40c47e05b146499faee56b0b4560f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Settings;
namespace Tango.DAL.Remote.DB
{
public partial class RemoteDB : DbContext
{
public RemoteDB(String path, bool isFile) : base(ComposeConnectionString(path, isFile))
{
}
private static String ComposeConnectionString(String source, bool isFile)
{
if (!isFile)
{
return String.Format("metadata=res://*/DB.RemoteADO.csdl|res://*/DB.RemoteADO.ssdl|res://*/DB.RemoteADO.msl;provider=System.Data.SqlClient;provider connection string=\"data source={0};initial catalog=Tango;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework\"", source);
}
else
{
return null;
}
}
public static RemoteDB CreateDefault()
{
return new RemoteDB(SettingsManager.Default.DataBase.SQLServerAddress, false);
}
}
}
|