Equ icon indicating copy to clipboard operation
Equ copied to clipboard

Case insensitive comparisons

Open ibebbs opened this issue 4 years ago • 0 comments

Hi,

I'm loving Equ and using it loads. Just come across a case where I'd like to perform a comparison of a class which contains a string property and I'd like the comparison to be case insensitive.

Looking at the code I was wondering if this could be achieved by making EqualityFunctionGenerator.MakeEqualsExpression virtual so it could be easily overriden in a derived class and, where appropriate changed to provide case insensitive comparison of strings. The derived class could then be passed into the MemberwiseEqualityComparer<T>.Custom method.

Does this sound plausible? Is there a better way to do this?

Thanks for your time and a great library.

ibebbs avatar Feb 05 '21 17:02 ibebbs