I have a query where I need to have ordeby based on a querystring parameter .For example if sortby parameter is price , Query needs to change with price . If its rating than change query to sort by rating .
I know PredicateBuilder can do And and OR stuff but how do I make a dynamic ordeby linq query .
Well, you could use a switch statement or something similar:
You could also do it with reflection, but assuming you have a limited number of fields to order by, this is quite possibly the simplest approach.