Add OrgId to LINQ query.

This commit is contained in:
Jared Goodwin 2020-01-28 18:44:54 -08:00
parent 60cc764426
commit 43d276bc14

View File

@ -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();
}