I have a class that has a property that is List, I will call this class A. Then I have List<A>
.
I need LINQ for objects in order to get all objects B that are present in ALL elements in List<A>
.
Example for clarification:
var list = new List<A> { new A { B = new List<B> { B1, B2, B3, B4 } } new A { B = new List<B> { B3, B4, B5, B6 } } new A { B = new List<B> { B2, B3, B4, B5, B6 } } };
The query should return B3 and B4 objects, since they are the only ones contained in all List<A>
objects.
Ignacio Soler Garcia
source share