I'm following John Papa's course on SPA's with Durandal and Breeze and I'm having a problem with the method EntityQuery.fromEntities. Indeed, I'm watching the course mainly as a reference to understand how to use Durandal and Breeze, because I'm coding a totally different SPA.
Indeed, the one I'm coding doesn't has just one Breeze controller, it has one controller per aggregate. So for each controller I have one Breeze's EntityManager. My doubt then is the following: I have one CustomersController, and following John's course to list just the table of customer I've made a projection query and loaded just partial entities.
Now, when I'm going to access the details and editing of each customer, I need the full data. So, I've used the following code in my viewmodel:
function reloadCustomer(customer) {
return EntityQuery.fromEntities(customer)
.using(customersManager).execute()
.then(querySucceeded);
}
The only problem is that this query is aimed with resourceName Customers. This is a problem, because since the customersManager has serviceName /api/customers the request is being made to /api/customers/Customers which doesn't exists.
How can I use the EntityQuery.fromEntities method when I have this scenario of multiple controllers, instead of a single /api/breeze service url?