public List <WaypointBeaconsMapping> FindTheMappingOfWaypointAndItsBeacon (Guid regionGuid, List <Guid> waypoints) { List <WaypointBeaconsMapping> waypointBeaconsMappings = new List <WaypointBeaconsMapping>(); foreach (Guid waypointID in waypoints) { RegionWaypointPoint regionWaypointPoint = new RegionWaypointPoint(); regionWaypointPoint._regionID = regionGuid; regionWaypointPoint._waypointID = waypointID; List <Guid> beaconIDs = new List <Guid>(); beaconIDs = _navigationGraph.GetAllBeaconIDInOneWaypointOfRegion(regionGuid, waypointID); Dictionary <Guid, int> beaconThresholdMapping = new Dictionary <Guid, int>(); for (int i = 0; i < beaconIDs.Count(); i++) { beaconThresholdMapping.Add (beaconIDs[i], _navigationGraph.GetBeaconRSSIThreshold(regionGuid, beaconIDs[i]) ); } waypointBeaconsMappings.Add(new WaypointBeaconsMapping { _WaypointIDAndRegionID = regionWaypointPoint, _Beacons = beaconIDs, _BeaconThreshold = beaconThresholdMapping }); } return(waypointBeaconsMappings); }