public async Task <IEnumerable <DTODevice> > GetIncidentDevices(int id) { IEnumerable <DTODevice> allDevices = await _service.GetDevice(); IEnumerable <DTOIncidentDevice> allIncidentDevices = await _incidentDeviceService.GetIncidentDevice(); List <DTODevice> retVal = new List <DTODevice>(); foreach (DTOIncidentDevice incDev in allIncidentDevices) { if (incDev.IncidentID == id) { retVal.Add(allDevices.FirstOrDefault(x => x.ID == incDev.DeviceID)); } } return(retVal.AsEnumerable()); }
public async Task <IEnumerable <DTOIncidentDevice> > GetIncidentDevice() { return(await _service.GetIncidentDevice()); }