I’ve an object list where each object contains an internal object list and what I would fetching is the father list (left list), however I’m forced to use SelectMany function..Is it possibile?
Naive Example:
var query = objList.SelectMany(p => p.InternalList)
.Where(internalObj => internalObj.SomeProprerty == true)
.SELECT(objList);
Is there any way to accomplish this?
Assuming you don’t actually want
objList, but instead the element ofobjListwhich we’re looking at at the time, I think you just want:If that’s not what you’re after, it would really help if you’d give a concrete example.
EDIT: If you only want any example from
objListwhere any element of the internal list has aSomePropertyvalue oftrue, you can do that more easily like this: