From e83057fa22e28c5fd231ae06a5a91464a6e3f596 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 25 Feb 2018 15:14:20 +0200 Subject: Integrated DB & MSUS to Twine Server. --- .../MachineStudioUpdateService.svc.cs | 17 +++++++++++++++-- .../Tango.MachineStudio.UpdateService.csproj | 3 +++ .../Tango.MachineStudio.UpdateService/Web.config | 6 +++--- 3 files changed, 21 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs index 2f001b281..5cc95c617 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/MachineStudioUpdateService.svc.cs @@ -97,6 +97,12 @@ namespace Tango.MachineStudio.UpdateService { db.Configuration.LazyLoadingEnabled = false; + //Load relation first... + db.Roles.ToList(); + db.Permissions.ToList(); + db.UsersRoles.ToList(); + db.RolesPermissions.ToList(); + var user = db.Users.SingleOrDefault(x => x.Email.ToLower() == request.Email.ToLower() && x.Password == request.Password); if (user != null && user.HasPermission(Permissions.PublishMachineStudioVersion)) @@ -185,9 +191,16 @@ namespace Tango.MachineStudio.UpdateService public string GetLatestVersion() { - using (ObservablesContext db = ObservablesContext.CreateDefaultForWeb()) + try { - return db.MachineStudioVersions.FirstOrDefault().Version; + using (ObservablesContext db = ObservablesContext.CreateDefaultForWeb()) + { + return db.MachineStudioVersions.FirstOrDefault().Version; + } + } + catch (Exception ex) + { + throw new FaultException(ex.ToString()); } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj index 0b4d78195..9e41b1725 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Tango.MachineStudio.UpdateService.csproj @@ -81,6 +81,9 @@ + + + Web.config diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.config b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.config index b0d2452f0..1805380e9 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.config +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UpdateService/Web.config @@ -6,8 +6,8 @@ - - + + @@ -21,7 +21,7 @@ - + -- cgit v1.3.1