I have a situation, where I am saving multiple types of entities during a single SaveChanges. In some cases, this save will include my "target entity", in some cases not. In those cases where the save does include a "target entity", i need to be able to trap the entity's id as returned from the server using saveChanges() saveResult.
I have been trying to figure out how to use the Breeze EntityType to see if my "target entity" in the the saveResult, but I keep on getting undefined in the approach below. Clearly I'm not understanding how to use this feature?
function trapTargetEntityId(saveResult) {
saveResult.entities.forEach(function(entity) {
if (entity.EntityType === 'targetEntity') {
targetEntitId = entity.id;
}
return;
});
}