Skip to content

Conversation

@trickpatty
Copy link

This change fixes an issue where, when reading the PrimaryKey property of an entity which was resolved from an abstract manifest (with the identifiedBy purpose on an attribute), the value cannot be retrieved.

When FetchTraitReferenceArgumentValue returns the value of the argument for the resolved is.identifiedBy trait, it returns either a string or a CdmAttributeReference. However, the subsequent process was looking to cast to a CdmTypeAttributeDefinition, which is not a compatible type. Since the only thing the code needs from that object is the name, it is safe to cast to the CdmObject instead and call the underlying FetchObjectDefinitionName() method.

This change makes the cast to CdmObject and returns the value successfully.

A unit test which addresses this situation is also included in the changes.

Scott Kearney added 2 commits August 8, 2024 15:55
…d entity from an abstract manifest.

Currently fails due to incompatible types.
The attRef returned can be cast to the base CdmObject type in order to just retrieve the object definition name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant