From cc19ab7414f097370b14f8655f76721701e3f47b Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 19 Dec 2018 17:08:28 +0200 Subject: Improved DB speed for Azure data source !! --- .../Visual_Studio/Tango.UnitTesting/DAL_TST.cs | 26 +++++++++------------- .../Visual_Studio/Tango.UnitTesting/Logging_TST.cs | 3 ++- .../Tango.UnitTesting/MachineService_TST.cs | 3 ++- .../Tango.UnitTesting/Tango.UnitTesting.csproj | 6 ++++- 4 files changed, 20 insertions(+), 18 deletions(-) (limited to 'Software/Visual_Studio/Tango.UnitTesting') diff --git a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs index 0ea7b59ef..02862350f 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs @@ -17,24 +17,20 @@ namespace Tango.UnitTesting { String guid = Guid.NewGuid().ToString(); - using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) - { - var action = new DAL.Remote.DB.ACTION_TYPES(); - action.CODE = 1; - action.NAME = "Action 1"; - action.DESCRIPTION = "Description 1"; - action.GUID = guid; - action.LAST_UPDATED = DateTime.UtcNow; + DataSource s = new DataSource(); + s.Type = DataSourceType.SQLServer; + s.Address = "twine.database.windows.net"; + s.Catalog = "Tango"; + s.IntegratedSecurity = false; + s.UserName = "Roy"; + s.Password = "Aa123456"; - db.ACTION_TYPES.Add(action); - db.SaveChanges(); - } - using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate().DataSource)) + using (var db = new DAL.Remote.DB.RemoteDB(s)) { - var action = db.ACTION_TYPES.Single(x => x.GUID == guid); - db.ACTION_TYPES.Remove(action); - db.SaveChanges(); + var events = db.EVENT_TYPES.ToList(); + var motors = db.HARDWARE_MOTOR_TYPES.ToList(); + var monitors = db.TECH_MONITORS.ToList(); } } diff --git a/Software/Visual_Studio/Tango.UnitTesting/Logging_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Logging_TST.cs index 6d95674ff..c4a697715 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Logging_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/Logging_TST.cs @@ -4,7 +4,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using Tango.MachineStudio.Logging.Parsing; +using Tango.Integration.Logging; +using Tango.Logging; namespace Tango.UnitTesting { diff --git a/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs index 94d30df98..0edab542a 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs +++ b/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.PMR.Synchronization; +using Tango.PPC.Common.MachineUpdate; using Tango.Transport.Web; namespace Tango.UnitTesting @@ -17,7 +18,7 @@ namespace Tango.UnitTesting public void Check_For_Updates() { IWebTransportClient client = new WebTransportClient(); - var result = client.Post("http://localhost:51581/api/PPC/CheckForUpdate", new CheckForUpdateRequest() + var result = client.PostJson("http://localhost:51581/api/PPC/CheckForUpdate", new CheckForUpdateRequest() { SerialNumber = "0000", Version = "0.0.0.0", diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index aa8b71dd1..6c547102c 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -128,6 +128,10 @@ {cb0b0aa2-bb24-4bca-a720-45e397684e12} Tango.MachineStudio.Common + + {0BE74EEE-22CB-4DBA-B896-793B9E1A3AC0} + Tango.PPC.Common + {f441feee-322a-4943-b566-110e12fd3b72} Tango.BL @@ -211,7 +215,7 @@ - + \ No newline at end of file -- cgit v1.3.1