Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CollectionGenericType to ClientPropertyAnnotation #3170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lawynn
Copy link
Contributor

@lawynn lawynn commented Jan 23, 2025

Modified EntryValueMaterializationPolicy to ensure the correct collection element type is used if a POCO does not have a collection initializer for collection properties.

Issues

This pull request fixes #3124.

Description

In cases where POCO classes are used, and contain collection properties, the materializer does not correctly identify the element type. The property.EntityCollectionItemType erroneously returns a null for complex types, which then fails on the MakeGenericType call.

This fix surfaces the CollectionGenericType, and uses that in the 2 logic branches that will fail if the value is null.

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Build and test with one-click build and test script passed

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.

Modified EntryValueMaterializationPolicy to ensure the correct collection element type is used if a POCO does not have a collection initializer for collection properties.
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.

OData.Client 8.2.1 does not materialize data service responses
1 participant