From 43d276bc1464568e29c0ea982fb53d094a629f18 Mon Sep 17 00:00:00 2001 From: Jared Goodwin Date: Tue, 28 Jan 2020 18:44:54 -0800 Subject: [PATCH] Add OrgId to LINQ query. --- Server/Services/DataService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Server/Services/DataService.cs b/Server/Services/DataService.cs index c09cf7fc..f0171fdf 100644 --- a/Server/Services/DataService.cs +++ b/Server/Services/DataService.cs @@ -473,7 +473,9 @@ namespace Remotely.Server.Services if (device != null) { device.Alias = options.DeviceAlias; - var group = RemotelyContext.DeviceGroups.FirstOrDefault(x => x.Name.ToLower() == options.DeviceGroup.ToLower()); + var group = RemotelyContext.DeviceGroups.FirstOrDefault(x => + x.Name.ToLower() == options.DeviceGroup.ToLower() && + x.OrganizationID == device.OrganizationID); device.DeviceGroup = group; RemotelyContext.SaveChanges(); }