So, class A contains list of class B objects. I have a list of class A objects. I would like to get list of all distinct class B objects from all class A objects in that listOfAObjects – in one query.
Currently I’m getting set of sets, add them individually with AddRange to helper list, and then call distinct on that list, but I’m not really happy with that, as you can imagine..
Thanks for helping tired people with trivial questions 🙂
You’ll need to use a combination of SelectMany (to aggregate all of the Class B lists into a single collection) and then Distinct (to weed out the duplicates):