i've updated client library , server web api dll latest version.
now whenever expand on query, kind of error:
unable locate property: mandate on type: mandatehistory:#dom.directdebit
with query being :
var query = breeze.entityquery.from("mandateshistory") .where("mandate.id", "==", mandatid).expand("mandate"); return manager.executequery(query.using(service));
if downgrade 1.3.3 (the client library only), works fine.
i have try 1.3.4 or 1.3.5 can't find them on website....
what has changed between 1.3.3 , 1.3.6 break application ?
edit
this code causing issues :
in 1.3.6, in function parsecsdnavproperty, following code added:
var constraint = association.referentialconstraint; if (!constraint) { // todo: revisit later - right ignore many-many , assocs missing constraints. return; // think adding later. //if (association.end[0].multiplicity == "*" && association.end[1].multiplicity == "*") { // // many many relation // ??? //} else { // throw new error("foreign key associations must turned on model"); //} }
basically, navigation property mandatehistory.mandate, there no contraint found, code return. cause of issue.
in version 1.3.3, there no check on constraint because first there following check returns false in case (isscalar false):
if (toend && isscalar) { var constraint = association.referentialconstraint; if (constraint) { var principal = constraint.principal; var dependent = constraint.dependent; var proprefs; if (csdlproperty.fromrole === principal.role) { proprefs = toarray(principal.propertyref); } else { proprefs = toarray(dependent.propertyref); } // used later np._update fknamesonserver = proprefs.map(__pluck("name")); } }
can breeze team ?
solution
following jay's suggestion, .net model had changed in order explicitly set foreign key association between mandatehistory , mandate:
public class mandatehistory { [foreignkey("mandate")] public int mandate_id { get; set; } public virtual mandate mandate { get; set; } }
my guess missing referential constraints in model. i.e. entity framework thinks not exposing foreign keys. see foreign keys in entity framework.
breeze requires foreign keys in order perform it's automatic object linking logic.
this described here: breeze navigation properties
Comments
Post a Comment