I am developing an asp.net solution with Durandal / breeze.
Here is my code to get all my shippers:
var query = EntityQuery.from('Shippers')
.select('id, name, street, city');
return manager.executeQuery(query)
.then(querySucceeded)
.fail(queryFailed);
Here is a related model:
public class Shipper
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
public string Street { get; set; }
public string Number { get; set; }
public City City { get; set; }
}
public class City
{
public int Id { get; set; }
public string Name { get; set; }
public string PostCode { get; set; }
public Country Country { get; set; }
}
Now I also need to specify the countries
public class Country
{
[Key]
public int Id { get; set; }
public string Code { get; set; }
public string Name { get; set; }
}
But with the actual request, I do not get the country with him.
I'm trying to:
var query = EntityQuery.from('Shippers')
.select('id, name, street, city')
.expand('City.Country');
but I get an error:
use of both 'expand' and 'select' in the same query is not currently supported
My question is : how to get countries?
UPDATE
As Jay suggested, we can do:
var query = EntityQuery.from('Shippers')
.select('id, name, street, city, city.country')
Now I have an object city_Country:

I don’t understand why we got this city_Countryone because the country data is already available in the city \ country object:

, , dto , city_Country .
entity city_Country:

- , ?
:
function mapToEntity(entity, dto) {
for (var prop in dto) {
if (dto.hasOwnProperty(prop)) {
entity[prop](dto[prop]);
}
}
return entity;
}