From @slawojstanislawski on September 5, 2015 11:54
Here's a link from a project built with MongoDb, angular and breezeJs:
https://github.com/johnpapa/ng-demos/blob/master/cc-bmean/src/client/app/data/repositories/repository.session.js#L65
On line 65 in the code, as part of a projection selection there are navigation properties' IDs included. So one can first download all the track, timeSlot and room entities (say, as part of some lookup query, as was provided as an example for a PHP app here: #12 (comment)), and then ask for such a projection, and since the navigation properites' entities are in the cache, one can make use of, say, session.timeSlot.name, or session.track.title, things like that, and the navigation properties are retrieved from cache appropriately for a given session (after casting the query result to session entity with toType() method).
In my sandbox model (based on EmpDirectory sample app) User entity has ManyToOne association with Job entity and a ManyToOne association with Department entity, and when I do:
breeze.EntityQuery.from('Users').toType("User")
with no projection, I get properties like jobId and departmentId in the results. When I try to use projection:
breeze.EntityQuery.from('Users').select('id, firstName, lastName, jobId').toType("User")
I get 500 server response:
Invalid select expression "X.lastName" (500 Internal Server Error)
There's clearly something I'm missing but I've been unable to pinpoint exactly what it is.
Copied from original issue: adrotec/AdrotecWebApiBundle#2