I have a pretty complex Linq statement with multiple joins, but am having a problem with an orderby statement.
I think I can reduce the question down a bit, but will expand if needed.
First my object has the following properties:
myObject.ID This is a basic Int
myObject.BrandName This is my HashSet<string>.
I need to sort my Object by the BrandName using the lowest or highest value depending on if I am sorting ascending or descending.
So you mean order by the minimum or maximum value in the set? Fortunately that’s easy – even if it’ll perform fairly badly:
or
(Or vice versa, depending on what ordering you want.)