icomparer
C# IComparer is returning unexpected result when comparing same strings
I have a situation where all of my list members have same ID (Id is string and not Integer). As part of business rules I need to sort the list in ascending order. My original implementation is quite s[详细]
2023-04-09 00:10 分类:问答Custom Comparer against a parameter failing
I am trying to write a custom comparer to sort a list of search results based on similarity.I would like the term most like the entered search term to appear first in the list, followed by phrases tha[详细]
2023-04-04 15:11 分类:问答In the List<T>.Sort() method, is an item ever compared to itself?
If I pass in a custom IComparer to an instance of a List\'s Sort() method, will the comparer\'s Compare(x,y) method ever be called with the same item?[详细]
2023-04-04 04:19 分类:问答Quick IComparer?
Before I go reinventing the wheel, is there some framework way of creating an IComparer<T> from a Func<T,T,int>?[详细]
2023-02-28 09:31 分类:问答IEqualityComparer and singleton
I was wondering if there is possibility to use singleton as comparerObject in for example Distinct ??[详细]
2023-02-24 08:35 分类:问答Should a custom comparer for strings allow for null values
I\'m looking at someone elses code for a custom comparer that compares strings. I\'m noticing that it will fall over if at least one of the string parameters is null.[详细]
2023-02-22 09:47 分类:问答How to use Distinct() in LINQ and how to pass own comparer
I am querying a table called STUDENT.I开发者_JAVA百科 want to retrieve 2 values, the STUDENT_ID, and the TIME (Both are strings). However, I only want the distinct values of STUDENT_ID. When I use Dis[详细]
2023-02-20 18:48 分类:问答C# List<T> Sort with IComparer argument gives compilation error
Can someone explain to me how this is supposed to work? I followed an MSDN example I found at http://msdn.microsoft.com/en-us/library/234b841s.aspx .[详细]
2023-02-15 02:59 分类:问答using Icomparer to sort with special condition
In my project i have a need to sort the datagrid column but if a certain 开发者_如何学编程condition holds true for an item it should be at the top(first item) of the sorted list. otherwise if that con[详细]
2023-02-13 02:46 分类:问答How to compare multiple object values against each other?
Assume i have a object with the following values in it (also please note i do not wish to use adatetime object for this, just the following values below and i wish to solve this in the comparer itself[详细]
2023-02-05 16:53 分类:问答