Any idea why the LINQ OrderBy is not working in following code, (have no errors but method does not sort ...)
First my own type
public class IQLinksV
Don't throw away the return value. The OrderBy
extension method is does not mutate the input. Try:
newView = newView.OrderBy(x => x.viewed);
There is no reason why that won't work, assuming the viewed
value is correct. Also, make sure that OrderBy
is after any operations (e.g. Distinct
) which will ruin ordering.
Happy coding!