I use IEnumerable orderby to sort my items in an upstream format, but it doesn’t work, my query looks like this:
IEnumerable<Step> steps = allsteps.Where(step => step.X <= Y); steps = steps.OrderBy(step => step.X);
it should not be used OrderBy or OrderByDescending
why?
I want to use the Sum() method to summarize some elements and the order of the elements is important (there are some rules)
I read on MSDN which needs to be listed in order to work, but what good (I have not tried).
EDIT: X and Y are of type double . I checked the first element of my steps (steps. First ()) in quick view mode.
c # linq sql-order-by ienumerable
Saeed amiri
source share