¡@

Home 

c# Programming Glossary: iequalitycomparer

Distinct() with lambda?

http://stackoverflow.com/questions/1300088/distinct-with-lambda

The equality comparer argument must be an instance of IEqualityComparer T . I can do this of course but it's somewhat verbose and well.. something Alternatively is there a way of specifying an IEqualityComparer inline embarass me Update I found a reply by Anders Hejlsberg.. by Distinct will not function correctly . We use IEqualityComparer because it packages compatible implementations of Equals and..

Remove duplicates in the list using linq

http://stackoverflow.com/questions/1606679/remove-duplicates-in-the-list-using-linq

a custom equality comparer e.g. class DistinctItemComparer IEqualityComparer Item public bool Equals Item x Item y return x.Id y.Id x.Name..

Can I specify my explicit type comparator inline?

http://stackoverflow.com/questions/188120/can-i-specify-my-explicit-type-comparator-inline

like foo1.key foo2.key. Rather than creating a new IEqualityComparer for the type can I simply specify the comparison inline using.. Something like var f1 ... f2 ... var f3 f1.Except f2 new IEqualityComparer Foo a Foo b a.key.CompareTo b.key I'm pretty sure the above.. public class ProjectionEqualityComparer TSource TKey IEqualityComparer TSource readonly Func TSource TKey projection readonly IEqualityComparer..

A dictionary object that uses ranges of values for keys

http://stackoverflow.com/questions/2147505/a-dictionary-object-that-uses-ranges-of-values-for-keys

it please I have already tried implementing a custom IEqualityComparer object and overloading Equals and GetHashCode on Interval but..

What guarantees are there on the run-time complexity (Big-O) of LINQ methods?

http://stackoverflow.com/questions/2799427/what-guarantees-are-there-on-the-run-time-complexity-big-o-of-linq-methods

n as well in general. What about the versions that use an IEqualityComparer OrderBy would need a sort so most likely we're looking at O..

Compare two List<T> objects for equality, ignoring order

http://stackoverflow.com/questions/3669970/compare-two-listt-objects-for-equality-ignoring-order

ScrambledEquals T IEnumerable T list1 IEnumerable T list2 IEqualityComparer T comparer var cnt new Dictionary T int comparer ... share..

Why is it important to override GetHashCode when Equals method is overridden?

http://stackoverflow.com/questions/371328/why-is-it-important-to-override-gethashcode-when-equals-method-is-overridden

T etc since this is used in the absense of a custom IEqualityComparer T to group items into buckets. If the hash code for two items..

Is there a built-in method to compare collections in C#?

http://stackoverflow.com/questions/43500/is-there-a-built-in-method-to-compare-collections-in-c

are equal by comparing their elements by using a specified IEqualityComparer T . You can't directly compare the list the dictionary but you..

Why is there no Linq method to return distinct values by a predicate?

http://stackoverflow.com/questions/520030/why-is-there-no-linq-method-to-return-distinct-values-by-a-predicate

method in Linq that will do this just one that takes an IEqualityComparer . I can hack around it with this return myList.GroupBy x x.Url.. IEnumerable TSource source Func TSource TKey keySelector IEqualityComparer TKey comparer if source null throw new ArgumentNullException.. IEnumerable TSource source Func TSource TKey keySelector IEqualityComparer TKey comparer HashSet TKey knownKeys new HashSet TKey comparer..

Look if a method is called inside a method using reflection

http://stackoverflow.com/questions/5741350/look-if-a-method-is-called-inside-a-method-using-reflection

GetEnumerator internal class CompareMembers T IComparer T IEqualityComparer T where T class IMemberReference public int Compare T x T y..

How to check if two Expression<Func<T, bool>> are the same [duplicate]

http://stackoverflow.com/questions/673205/how-to-check-if-two-expressionfunct-bool-are-the-same

is used inside Linq to db4o . It implements the interface IEqualityComparer T so it's usable for generic collections as well as for a standalone..

Merge two object lists with linq

http://stackoverflow.com/questions/720609/merge-two-object-lists-with-linq

objects you can also write a comparer class which uses the IEqualityComparer interface. You can then provide this comparer as the second..