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

String Comparison with OrdinalIgnoreCase #106

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

Conversation

AdemCatamak
Copy link

#73

During the string comparison instead of 'CurrentCultureIgnoreCase', 'OrdinalIgnoreCase' is used. As a result, the case of unit tests in Turkish systems resulting with a failure is resolved.

Old PR : DapperLib/Dapper#1023

 During the string comparison instead of 'CurrentCultureIgnoreCase', 'OrdinalIgnoreCase' is used. As a result, the case of unit tests in Turkish systems resulting with a failure is resolved.
@johandanforth
Copy link
Contributor

Have you tried InvariantCultureIgnoreCase ? I can't test things now, but it may be the best case? This is usually good for a neutral comparison that still takes into account some linguistic aspects.

var idProp = allProperties.Find(p => string.Equals(p.Name, "id", StringComparison.InvariantCultureIgnoreCase));

@AdemCatamak
Copy link
Author

I have tried InvariantCultureIgnoreCase. In my pr which is for the previous repository of the project, I linked the test-cases. It works as expected. I agree with you, InvariantCultureIgnoreCase is the best approach in cases like this.

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