Skip to content

Conversation

WanjohiSammy
Copy link
Member

@WanjohiSammy WanjohiSammy commented Aug 5, 2025

Issues

This pull request fixes

Description

OData queries fail when filtering against Flags enum properties using combined enum values, whether specified as string representations ('Premium,Loyal') or numeric equivalents (66).

The current implementation in MetadataBindingUtils.cs does not properly handle:

  • Combined flag values in string format (e.g., 'Premium,Loyal')
  • Numeric representations of combined flags (e.g., 66 for Premium | Loyal)

Changes Made

  • Enhanced enum value parsing logic in MetadataBindingUtils.cs
  • Added support for comma-separated flag combinations in string format
  • Implemented numeric value parsing for combined flags
  • Updated validation logic to recognize valid flag combinations

Query Patterns Now Supported

  • /customers?filter=Type eq 'Premium,Loyal'
  • /customers?filter=Type eq 66
  • /customers?filter=Type in ('Premium', 'VIP,Regular,Returning')
  • /customers?filter=Type in (12, 44)
  • /customers?filter=Type in ('12', '44')

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.

Repository notes

Team members can start a CI build by adding a comment with the text /AzurePipelines run to a PR. A bot may respond indicating that there is no pipeline associated with the pull request. This can be ignored if the build is triggered.

Team members should not trigger a build this way for pull requests coming from forked repositories. They should instead trigger the build manually by setting the "branch" to refs/pull/{prId}/merge where {prId} is the ID of the PR.

@WanjohiSammy
Copy link
Member Author

/AzurePipelines run

Copy link

No pipelines are associated with this pull request.

@WanjohiSammy
Copy link
Member Author

/AzurePipelines run

Copy link

No pipelines are associated with this pull request.

@WanjohiSammy WanjohiSammy marked this pull request as ready for review August 7, 2025 09:55
@WanjohiSammy WanjohiSammy requested review from xuzhg, ElizabethOkerio, habbes and gathogojr and removed request for xuzhg August 7, 2025 09:55
@WanjohiSammy WanjohiSammy force-pushed the fix/3244-support-flags-enum branch from 8e03a95 to 2bfab4c Compare August 23, 2025 17:23
@WanjohiSammy
Copy link
Member Author

/AzurePipelines run

Copy link

No pipelines are associated with this pull request.

@WanjohiSammy
Copy link
Member Author

/AzurePipelines run

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.

2 participants