internal MapLocationFinderResult(RestResponse restResponse) { var locations = new List <MapLocation>(); Locations = locations; try { foreach (var resourceSet in restResponse.resourceSets) { foreach (var resource in resourceSet.resources) { var mapLocation = new MapLocation(resource.name, resource.point, resource.address, resource.entityType); locations.Add(mapLocation); } } } catch (Exception) { Status = MapLocationFinderStatus.BadResponse; return; // Early out. } Status = locations.Count > 0 ? MapLocationFinderStatus.Success : MapLocationFinderStatus.EmptyResponse; }
internal MapLocationFinderResult( IReadOnlyList <MapLocation> locations, MapLocationFinderStatus status ) { Locations = locations; Status = status; }
internal MapLocationFinderResult(MapLocationFinderStatus status) { Locations = new List <MapLocation>(); Status = status; }