I have 2 fields for sorting: Product Name and Price plus 2 options: ascending or descending.
User can specify sort order by setting 2 checkboxes: Price checkbox on or off and ascending checkbox on or off.
How do I code the orderby clause when the sorting order is dynamically set based on settings of the 2 above checkboxes? Thanks.
You can build the query by conditionally specifying
OrderByclauses: