public ActionResult <ContinentRestOutput> Get(int id) { log("Get"); try { Continent continent = contRepos.GetContinent(id); List <string> countryUrls = new List <string>(); ContinentRestOutput continentRestOutput = new ContinentRestOutput(id, continent.Name, continent.Population); if (continent.CountryMappings != null) { foreach (CountryMapping cm in continent.CountryMappings) { string url = $"http://localhost:50055/api/continent/{id}/country/{cm.CountryId}"; countryUrls.Add(url); } continentRestOutput.CountryId = countryUrls; } return(continentRestOutput); } catch (GeoException ex) { return(NotFound(ex.Message)); } }