Top "Icomparer" questions

IComparer is an interface provided by the .NET framework, used in conjunction with the Array.

Using IComparer for sorting

I am trying to use an IComparer to sort a list of Points. Here is the IComparer class: public class …

c# sorting icomparer
Use own IComparer<T> with Linq OrderBy

I have a generic List<MyClass> where MyClass has a property InvoiceNumber which contains values such as: 200906/1 200906/2 .. 200906/10 200906/11 200906/12 My …

c# linq sql-order-by icomparer
difference between IComparable and IComparer

What is the difference between IComparable and IComparer Interfaces? Is it necessary to use this interface always with Array.Sort() …

c# .net icomparable icomparer
Pass a lambda expression in place of IComparer or IEqualityComparer or any single-method interface?

I happened to have seen some code where this guy passed a lambda expression to a ArrayList.Sort(IComparer here) …

linq extension-methods ienumerable iequalitycomparer icomparer
Implementing custom IComparer with string

I have a collection of strings in c#, for example; var example = new string[]{"c", "b", "a", "d"}; I then …

c# icomparer
Using lambda expression in place of IComparer argument

Is it possible with C# to pass a lambda expression as an IComparer argument in a method call? eg something …

c# lambda icomparer
When to use IComparable<T> Vs. IComparer<T>

I'm trying to figure out which of these interfaces I need to implement. They both essentially do the same thing. …

.net icomparable icomparer
C# lambda expressions and IComparer

I am using lambda expressions to sort and search an array in C#. I don't want to implement the IComparer …

c# lambda binary-search icomparer
How to use custom IComparer for SortedDictionary?

I am having difficulties to use my custom IComparer for my SortedDictionary<>. The goal is to put email …

c# icomparer sorteddictionary
How do I use a custom comparer with the Linq Distinct method?

I was reading a book about Linq, and saw that the Distinct method has an overload that takes a comparer. …

linq distinct icomparer