Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Sep 06, 2007 11:43 AM|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?