How does LINQ .distinct method sort?
问题 Let's say I'm using the LINQ array .Distinct() method. The result is unordered. Well, everything is "ordered" if you know the logic used to produce the result. My question is about the result set. Will the resulting array be in the "first distinct" order or perhaps the "last distinct" order? Can I never count on any order? This is the old "remove duplicate strings" problem but I'm looking into the LINQ solution. 回答1: Assuming you mean LINQ to Objects, it basically keeps a set of all the