private async Task <IncidentDto> MapNearby(Incident incident, uint radius, GeoCoordinate currentCoordinate)
        {
            var incidentCoordinate = new GeoCoordinate(double.Parse(incident.Latitude), double.Parse(incident.Longitude));
            var returnMe           = currentCoordinate.GetDistanceTo(incidentCoordinate) < radius?_objectMapper.Map <IncidentDto>(incident) : null;

            if (returnMe != null)
            {
                returnMe.ImagePath = (await _imageRepository.GetAllListAsync()).Where(image => image.Id == incident.ImageId)
                                     .Select(image => _imageStorageService.GetImageLink(image.ImagePath)).FirstOrDefault();
            }

            return(returnMe);
        }
Пример #2
0
 public IActionResult Image(string imageLocation)
 => Ok(_imageStorageService.GetImageLink(imageLocation));