In our project we are performing a projection query on the server. The resource name of the projection query has the same name as an EntityType. When we receive the results Breeze is trying to stuff our results into the EntityType. After stepping through the code I believe this happens in the visitAndMerge
function.
if (mappingContext.query && nodeContext.nodeType === "root" && !meta.entityType) {
meta.entityType = mappingContext.query._getToEntityType &&
mappingContext.query._getToEntityType(mappingContext.entityManager.metadataStore);
}
The _getToEntityType
eventually calls _getFromEntityType
which is matching our resource with our EntityType. Not quite sure if this is a bug or more of a Breeze rule, but we thought we would bring it up because we had a case where we didn't want to match the resource name to the EntityType.