Skip to content

Turn Matches and IsExactly into EqualityComparer<Base> #2928

@ewoutkramer

Description

@ewoutkramer

We can rewrite Matches and IsExactly in terms of GetElementPairs(), or even IReadOnlyDictionary. This could be done as in-place replacements for the current methods (who then don't need to be virtual anymore), but we could also turn them into a ExactEqualityComparer<T> and PatternEqualityComparer<T> to align with the normal .NET strategy of implementing System.Collections.Generic.EqualityComparer<Base> for these kind of purposes.

Again, as a guide to the user, we can leave the old methods in, throw not implemented and add an Obsolete with a message to indicate you should use the comparers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions