В этом случае Страна - это сводный корень, он должен быть заполнен всеми содержащимися в нем городами, тогда вы можете просто получить нужную страну и найти города внутри совокупного корня.
public class City
{
public int Id {get;set;}
public string Name {get;set;}
public double Longitude {get;set;}
public double Latitude {get;set;}
public City(Country country)
{ this.Country = country; }
}
public class Country
{
public int Id {get;set;}
public string Name {get;set;}
public IEnumerable<City> Cities {get;set;}
}
...
Country myCountry = repository.GetCountryByID(xyz); // return a country with all cities filled
City myCity = myCountry.Cities.First(c => c.Id = cityId);
return myCity;
...
В зависимости от дизайна, если City является агрегированным корнем, тогда дизайн будет
public class City
{
public int Id {get;set;}
public string Name {get;set;}
public double Longitude {get;set;}
public double Latitude {get;set;}
public Country Country {get;set;}
}
public class Country
{
public int Id {get;set;}
public string Name {get;set;}
}
...
City myCity = repository.GetCityByID(xyz); // return a city with the associated country
Country myCountry = myCity.Country;
return myCity;
...