Sep 06, 2007 11:43 AM|vs2005|LINK
Does anyone know if it is possible to programmatically set the orderby and ascending/descending conditions within a Linq statement (such as passing in values from the method parameter
For example, assuming that I am using the following example Linq statement:
IOrderedQueryable<Employees> hireQuery =
from emp in db.Employees
orderby emp.HireDate descending
Is it possible to programmatically set the orderby line programmatically by passing in dynamic values for the orderby column and where the column will be ascending/descending, rather than hard-coding such values?