aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.DAL.Local/Partials
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2017-11-27 20:35:08 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2017-11-27 20:35:08 +0200
commit7060dc80c707fc0441ff69fe4f899107cb3f6fc1 (patch)
treea72e2cf1be9fcce77e27446d93501bfc9b452265 /Software/Visual_Studio/Tango.DAL.Local/Partials
parentd1038a08bdf51b1310be4ef00ebe9e21b0e12f81 (diff)
downloadTango-7060dc80c707fc0441ff69fe4f899107cb3f6fc1.tar.gz
Tango-7060dc80c707fc0441ff69fe4f899107cb3f6fc1.zip
Split DAL to DAl.Local & DAL.Remote due to ambiguity of table names in EF.
Implemented Unit testing for SQLite & SQL Server connections.
Diffstat (limited to 'Software/Visual_Studio/Tango.DAL.Local/Partials')
-rw-r--r--Software/Visual_Studio/Tango.DAL.Local/Partials/LocalDB.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.DAL.Local/Partials/LocalDB.cs b/Software/Visual_Studio/Tango.DAL.Local/Partials/LocalDB.cs
new file mode 100644
index 000000000..2ad765a2b
--- /dev/null
+++ b/Software/Visual_Studio/Tango.DAL.Local/Partials/LocalDB.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Data.Entity;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.DAL.Local.DB
+{
+ public partial class LocalDB : DbContext
+ {
+ public LocalDB(String filePath) : base(ComposeConnectionString(filePath))
+ {
+
+ }
+
+ private static String ComposeConnectionString(String filePath)
+ {
+ return String.Format("metadata=res://*/DB.LocalADO.csdl|res://*/DB.LocalADO.ssdl|res://*/DB.LocalADO.msl;provider=System.Data.SQLite.EF6;provider connection string=\"data source={0}\"", filePath);
+ }
+ }
+}