Dapper.Contrib
Dapper.Contrib copied to clipboard
String Comparison with OrdinalIgnoreCase
#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 : https://github.com/DapperLib/Dapper/pull/1023
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));
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.