I have encountered an issue when using Breeze.js along with an Asp.net Web Api (with Entity Framework 6 Code First). After calling executeQuery(query), I am unable to retrieve entities. Here is the JavaScript code snippet:
entityManager.executeQuery(query)
.then(function(data){
alert(data.results.length); // length > 0 -- has data !!
alert(entityManager.getEntities().length); // == 0 has no data WHY?!!
});
Even though executeQuery(query) successfully calls my api controller on the server and returns data to the client (as evidenced by data.results.length being greater than 0), it seems like the data is not cached as entityManager.getEntities().length remains at 0. This raises the question of how changes can be tracked if the data is not being cached. Is there something that I may be overlooking? Upon researching, I came across a post , which mentions that Simply put, Breeze requires that the models and dbcontext be in the same namespace. Could this be the root cause of the problem? Given that I cannot modify the namespaces (since the dbcontext and api controllers are from an external library beyond my control), what workaround options could be considered?