diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-11-27 20:35:08 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-11-27 20:35:08 +0200 |
| commit | 7060dc80c707fc0441ff69fe4f899107cb3f6fc1 (patch) | |
| tree | a72e2cf1be9fcce77e27446d93501bfc9b452265 /Software/Visual_Studio/Tango.DAL.Remote/Partials | |
| parent | d1038a08bdf51b1310be4ef00ebe9e21b0e12f81 (diff) | |
| download | Tango-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.Remote/Partials')
| -rw-r--r-- | Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs b/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs new file mode 100644 index 000000000..6fdd35983 --- /dev/null +++ b/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +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; + } + } + + + } +} |
