Beispiel #1
0
        public async Task <IActionResult> FindClosestMission([FromBody] AddressRequest address)
        {
            (MissionResponse missionResponse, double distance) = await _missionService.FindClosestMission(address.TargetLocation);

            if (missionResponse == null)
            {
                return(NotFound(address.TargetLocation));
            }

            return(Ok(new { Mission = missionResponse, distanceInMile = Math.Round(distance, 2) }));
        }