Issue with TaxonomyManager in Sitefinity 10
We recently upgraded our Sitefinity version from 8 to 10. In a scenario we are fetching hierarchical taxonomies as below
This was working fine in Sitefinity 8, after upgrade it threw an error of type "Telerik.OpenAccess.Exceptions.DataStoreException" with message "Error executing query: Telerik.OpenAccess.RT.sql.SQLException: The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP, OFFSET or FOR XML is also specified."
Is there any change in implementation of taxonomy manager and how to write query for the given scenario
What about .ToList before the OrderBy to force the query to memory instead of sql?
Tried that. "OrderBy(t => t.Ordinal)" is not causing any issues, it's "order by title" added by taxonomy manager for the first query(order by in sub query). However if I use ToList() on first query as well as manager.GetTaxa<HierarchicalTaxon>().ToList() on second query, it works. But I do not want to fetch all the hierarchical taxonomy before filtration.
Simplified the query as below, so it wont have sub query.