/// <summary> /// Assign the sensors to the given network /// </summary> /// <param name="SensorBulkAssing">Sensor bulk Assing model</param> /// <returns>Success/Failure</returns> public async Task <List <SensorBulkResponse> > BulkAssignSensor(Model.DTO.SensorBulkAssign SensorBulkAssing) { List <SensorBulkResponse> response = new List <SensorBulkResponse>(); foreach (var sensorID in SensorBulkAssing.SensorIDs) { response.Add(new SensorBulkResponse() { SensorID = sensorID, Result = await AssignSensor(sensorID, SensorBulkAssing.NetworkID) }); } return(response); }
public async Task <IHttpActionResult> BulkAssignSensor([FromBody] Model.DTO.SensorBulkAssign SensorBulkAssign) { return(Ok(await _sensorApplicationService.BulkAssignSensor(SensorBulkAssign))); }