linq zu SQL Converter online
from location in _context.Businessunit
where request.locationId.Contains(location.Id)
join client in _context.Businessunit on location.Parentbusinessunitid equals client.Id
join building in _context.Area on location.AddressId equals building.AddressId
where building.Appcategoryname == "Building" && building.IsEnable == true
join floor in _context.Area on building.Id equals floor.Parentareaid
where floor.Appcategoryname == "Floor" && building.IsEnable == true
join department in _context.Area on floor.Id equals department.Parentareaid
where department.Appcategoryname == "Department" && building.IsEnable == true
join equipment in _context.Equipment on department.Id equals equipment.Areaid
join device in _context.Device on equipment.Id equals device.Equipmentid
where device.IsEnable == true
select new
{
deviceId = device.Id,
deviceName = device.Devicename,
deviceNummber = device.DeviceNumber,
isConnected = device.IsConnected,
lastConnected = device.LastConnected,
lastSprayCycle = device.LastActualCommunicatedAt,
location_name = location.Name,
customer = client.Name,
building_name = building.AreaName,
floor_name = floor.AreaName,
department_name = department.AreaName,
}
Outrageous Opossum