After working for months with a breeze WebAPI controller, I'm now about to start a new project with a standard WebAPI controller (I'm not that excited about it and I've got a bad feeling not being able to fully rely on breeze...)
Anyway, I'm trying to configure breeze on the client side and I'm running into an exception:
´Cannot get property « jsonResultsAdapter » of an undefined or null reference´
Here's how I've configured breezejs.
- I've added datajs.js to my project (and to the html page of course)
breeze service configuration
var service = new breeze.DataService({ serviceName: ('http://localhost:52446/api'), adapterName: 'OData' }); var manager = new breeze.EntityManager({ dataService: service }); //skip irrelevant code function search() { var query = breeze.EntityQuery.from("Mandate"); return manager.executeQuery(query.using(service)).then(function (result) { }).fail(function (error) { logger.error(error); }); }
When I debug breezejs:
proto.using = function (obj) {
if (!obj) return this;
var eq = this._clone();
processUsing(eq, {
entityManager: null,
dataService: null,
queryOptions: null,
fetchStrategy: function (eq, val) { eq.queryOptions = (eq.queryOptions || new QueryOptions()).using(val) },
mergeStrategy: function (eq, val) { eq.queryOptions = (eq.queryOptions || new QueryOptions()).using(val) },
jsonResultsAdapter: function (eq, val) { eq.dataService = (eq.dataService || new DataService()).using({ jsonResultsAdapter: val }) }
}, obj);
return eq;
};
jsonResultAdapter is null and not set.
Why is that ?