How can we improve Breeze.js?

Fix Navigation Property Update When Changing a Composite Foreign Key

In an entity that has a navigation property based on a composite foreign key (i.e. based on more than one foreign key properties), when setting one of the FK properties, breezejs tries to update the navigation property, however it searches for the foreign entity using a single key instead of a composite key, so it never finds the property.

To see what I mean and for a possible fix, please refer to breeze.debug.js (v.1.4.8) lines 4907 and 4908:
key = new EntityKey(relatedNavProp.entityType, [newValue]);
relatedEntity = entityManager.findEntityByKey(key);

The related entity never gets found since the key consists only of a single value [newValue] instead of the multiple values defined by the multiple foreign key properties.

30 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Milen Kovachev shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

2 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base