public async Task <List <RoadAndAirTempData> > GetDataLocation(LocationRadiusDTO locationInfo) { List <RoadAndAirTempData> retList = new List <RoadAndAirTempData>(); var data = _unitOfWork.CassandraSession.Execute(_cassandraService.SelectAllQuery(_unitOfWork.TemperatureTable)); RoadAndAirTempData newest = null; foreach (var instance in data) { RoadAndAirTempData roadData = _cassandraService.ConvertCassandraTempRow(instance); if (_geolocationService.CalculateDistance(locationInfo.CenterLatitude, locationInfo.CenterLongitude, roadData.Latitude, roadData.Longitude) <= locationInfo.RadiusMeters) { if (!locationInfo.Newest) { retList.Add(roadData); } else if (newest == null || newest.Timestamp < roadData.Timestamp) { newest = roadData; } } } if (locationInfo.Newest) { retList.Add(newest); } return(retList); }