I have two different lists where one is a bunch of ID’s as in a List<int> idsList, the other however is a list of objects like List<MyObject> myObjectList where the object looks like this:
class MyObject{
private List<int> ids;
public MyObject(List<int> ids){
this.ids = ids;
}
public List<int> Ids{
get{
return ids;
}
}
}
As you can see each object can contain one or multiple IDs (never zero or null ids). So what I need at the end is to know what objects in myObjectList have any id(s) from my idsList.
So far if I do:
var ids = from g in onScreen where g.Ids.Contains(myIntVariable) select g;
it would give me a list of the object(s) that contain myIntVariable. What I do not know how to do is to match the content of the idsList with the list in MyObject.
Thanks!
One way to go: