Skip to content

Allow null values in constant collections #1375

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

Conversation

KanishManuja-MS
Copy link
Contributor

Issues

This pull request fixes issue #1373 .

Description

CollectionConstantNode did not account for null values in the collection even if the item type is nullable.

Checklist (Uncheck if it is not completed)

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

Additional work necessary

I would like to test the nightly build against a sample WebAPI service to ensure that the filter works correctly all the way through for constant collections with null values in it.

@KanishManuja-MS KanishManuja-MS added the Ready for review Use this label if a pull request is ready to be reviewed label Jan 10, 2019
@KanishManuja-MS KanishManuja-MS added this to the 7.6 milestone Jan 10, 2019
@@ -54,7 +54,7 @@ public CollectionConstantNode(IEnumerable<object> objectCollection, string liter

foreach (object item in objectCollection)
{
this.collection.Add(new ConstantNode(item, item.ToString(), this.itemType));
this.collection.Add(new ConstantNode(item, item != null ? item.ToString() : "null", this.itemType));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May we replace the hard code "null" as other code?

@KanishManuja-MS KanishManuja-MS merged commit 64d8f34 into OData:master Jan 14, 2019
xuzhg pushed a commit to xuzhg/odata.net that referenced this pull request Feb 14, 2019
jfshark pushed a commit to jfshark/odata.net that referenced this pull request Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for review Use this label if a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants