Why my orderby method in linq does not work?

The call to Distinct() will undo your ordering, since it does not preserve the input sequence order. You need to perform your OrderBy after the Distinct() call: List query = dc.ZipTables. Select(z => z.

State) .Distinct() . OrderBy(s => s) .ToList().

It doesn't work Reed, the table has multiple columns, not just State column. – Steven Zack Jul 25 at 17:56 @Steven Zack: Edited to correct... This should work now. (Sorry about that - had misread the original slightly) – Reed Copsey Jul 25 at 18:30 thank you very much!

It works perfectly. – Steven Zack Jul 25 at 18:41.

Then only second method is applied, the first one is ignored. Is it a bug? What if I need to have ascending ordering for one column and descending ordering for another?

Is it not achievable at all by method syntax?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions