ISwearIHaveTheReference - fix for: Null Reference Exception thrown when creating model with entity splitting and table splitting
When configuring relationships we modify AssociationType KeyMembers collection. However to get AssociationEndMember from
AssociationSet we were using AssociationType Members collection. Members collection cannot be modified so KeyMembers and
Members collection can get out of synch when configuring relationships. It "worked" before #c8dc315 since we had accessed
ends using their index however we would return a stale end. With #c8dc315 we no longer accessed ends by their index but by
name and since Members collection was not modifed it did not have the end we were looking for and hence NRE. The fix is
to use KeyMembers instead of Members since they are updated when configuring relationships.
Also fixing AssociationType to return AssociationEndMembers based on KeyMembers and not on Members. Otherwise the returned
ends might not be correct (stale).
WorkItem: 867
↧