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

Potential fix for issue #616 #947

Merged
merged 6 commits into from
Jun 30, 2023
Merged

Conversation

orty
Copy link
Contributor

@orty orty commented May 31, 2023

Based on issue #616 which I also encountered, I would like to propose this fix.

As I am not completely aware of side-effects that using only edmProperty.Name could have, I relied on a safe way to rollback to the EDM property name instead of the CLR one if the latter is not found.

https://github.com/OData/AspNetCoreOData/blob/10a246671b6312fd234151c47cc91787da5cb171/src/Microsoft.AspNetCore.OData/Query/Query/DefaultSkipTokenHandler.cs#LL136C1-L145C18

I tested this change with my current project, but I suspect that some unit tests might have to be "doubled" with a builder.EnableLowerCamelCase() scenario to check for regressions on property retrieval when using a lowercased convention.

edit: Also tested along with the [DataContract] and [DataMember] attributes which create aliases for properties.

@orty
Copy link
Contributor Author

orty commented May 31, 2023

@microsoft-github-policy-service agree

@orty
Copy link
Contributor Author

orty commented Jun 6, 2023

@xuzhg did you have a chance to take a look at this PR ?
If anything needs a rework or is not compliant with your expectations, feel free to let me know, we had to downgrade some features in our application, waiting for this fix, because of the inability to use $select along with both EnableLowerCamelCase() and paging.

Thanks

Copy link
Contributor

@KenitoInc KenitoInc left a comment

Choose a reason for hiding this comment

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

Add tests

@orty
Copy link
Contributor Author

orty commented Jun 8, 2023

Hi @KenitoInc ,
I am a bit afraid of the amount of UT which would need an update to validate this scenario, but I will certainly give it a shot

@orty
Copy link
Contributor Author

orty commented Jun 8, 2023

@KenitoInc , it was not as much a hassle as I thought :) . Hope this new commit fulfils your requirements

@orty orty requested a review from KenitoInc June 9, 2023 16:00
@orty orty requested a review from gathogojr June 26, 2023 12:30
Copy link
Contributor

@gathogojr gathogojr left a comment

Choose a reason for hiding this comment

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

Thanks @orty for your contribution

@orty
Copy link
Contributor Author

orty commented Jun 29, 2023

Thanks @orty for your contribution

You're welcome ! @KenitoInc, do you agree with the overall changes ?

@KenitoInc KenitoInc merged commit ea97f91 into OData:main Jun 30, 2023
2 checks passed
@KenitoInc
Copy link
Contributor

@orty Thanks for this PR

@orty orty deleted the skiptoken-with-select branch June 30, 2023 15:49
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.

3 participants