Latest version(s) of Breeze appear to break executeQueryLocally. For example:
var query = new breeze.EntityQuery()
.from("Items").where('id', '==', id);
return manager.executeQueryLocally(query);
The issue I am encountering is in the stringEquals call in getPredicateFn.
In the case of the simple query above, trim()is being called on id causing a
5 has no method ‘trim’
Exception.
Here is the Breeze stringEquals function:
function stringEquals(a, b, lqco) {
if (lqco.usesSql92CompliantStringComparison) {
a = (a || "").trim();
b = (b || "").trim();
}
if (!lqco.isCaseSensitive) {
a = (a || "").toLowerCase();
b = (b || "").toLowerCase();
}
return a == b;
}
Edit
id is defined as int on the Items model and is numeric in JavaScript. Earlier version of Breeze did not do stringEquals so there was no attempt to trim a numeric.
Ok, this should be fixed. Please check v0.73.1. Breeze predicates will now perform type coercion when comparing values of different types (like strings vs numerics).