Dynamic LINQ OrderBy on IEnumerable / IQueryable

I found an example in the VS2008 Examples for Dynamic LINQ that allows you to use a SQL-like string (e.g. OrderBy(“Name, Age DESC”)) for ordering. Unfortunately, the method included only works on IQueryable<T>. Is there any way to get this functionality on IEnumerable<T>? 22 s 22 Just stumbled into this oldie… To do this without … Read more

Returning IEnumerable vs. IQueryable

What is the difference between returning IQueryable<T> vs. IEnumerable<T>, when should one be preferred over the other? IQueryable<Customer> custs = from c in db.Customers where c.City == “<City>” select c; IEnumerable<Customer> custs = from c in db.Customers where c.City == “<City>” select c; Will both be deferred execution and when should one be preferred over … Read more