iorderedenumerable

How does Linq use IEnumerable methods after an IOrderedEnumerable method?

In Linq, extension methods like Where return an IEnumerable collection, but sorting methods like OrderBy return an IOrderedEnumerable collection. So, if you have a query that ends with OrderBy (i.e. returns an IOrderedEnumerable), you can't later append a Where method - the compiler complains about the type being passed into Where. var...

Can it be advantageous for a method to return IOrderedEnumerable<T> instead of IEnumerable<T>?

Can it be advantageous for a method to return IOrderedEnumerable instead of IEnumerable? ...

IOrderedEnumerable and defensive programming

Hi, I'm fond of defensive programming. I hate exception throwing, but this is not the subject of my question. I adapted an extension to linQ to be able to perform an order by with a column name public static IEnumerable<T> OrderBy<T>(this IEnumerable<T> list, string sortExpression) With defensive programming, this method ret...