From 7060dc80c707fc0441ff69fe4f899107cb3f6fc1 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 27 Nov 2017 20:35:08 +0200 Subject: Split DAL to DAl.Local & DAL.Remote due to ambiguity of table names in EF. Implemented Unit testing for SQLite & SQL Server connections. --- .../Tango.DAL.Local/Partials/LocalDB.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Software/Visual_Studio/Tango.DAL.Local/Partials/LocalDB.cs (limited to 'Software/Visual_Studio/Tango.DAL.Local/Partials') 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); + } + } +} -- cgit v1.3.1