diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-21 10:50:41 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-21 10:50:41 +0300 |
| commit | b4a1c833f0e67835e89961e77329efe5bf2a7797 (patch) | |
| tree | 94354be095256a33d6d2ee285c183686e5e85c39 /Software/Visual_Studio/Tango.DAL.Remote/Partials | |
| parent | 51afc4f6a17383e91a72c2ce060e82604d43c3a8 (diff) | |
| download | Tango-b4a1c833f0e67835e89961e77329efe5bf2a7797.tar.gz Tango-b4a1c833f0e67835e89961e77329efe5bf2a7797.zip | |
Refactored ObservablesContext to use DataSource object!
Upgraded to .NET 4.7.2 !!!
Diffstat (limited to 'Software/Visual_Studio/Tango.DAL.Remote/Partials')
| -rw-r--r-- | Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs b/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs index a492df462..5905a0f7e 100644 --- a/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs +++ b/Software/Visual_Studio/Tango.DAL.Remote/Partials/RemoteDB.cs @@ -20,36 +20,9 @@ namespace Tango.DAL.Remote.DB /// </summary> /// <param name="path">The server file path.</param> /// <param name="isFile">if set to <c>true</c> will try to connect to an .mdf file.</param> - public RemoteDB(String path, bool isFile) : base(ComposeConnectionString(path, isFile)) + public RemoteDB(DataSource dataSource) : base(dataSource.ToConnection(), true) { } - - /// <summary> - /// Composes the connection string. - /// </summary> - /// <param name="source">The source.</param> - /// <param name="isFile">if set to <c>true</c> [is file].</param> - /// <returns></returns> - 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; - } - } - - /// <summary> - /// Creates a default remote database context by the address specified in <see cref="SettingsManager.Default.DataBase.SQLServerAddress"/>. - /// </summary> - /// <returns></returns> - public static RemoteDB CreateDefault() - { - return new RemoteDB(SettingsManager.Default.GetOrCreate<CoreSettings>().DataBaseSource, false); - } } } |
