using System.Collections.Generic;
public static void Main()
var setOfPersons = new List<List<Person>>();
var firstPersonList=new List<Person>();
Person p1=new Person(100,"James");
Person p2=new Person(200,"Smith");
setOfPersons.Add(firstPersonList);
List<Person> secondPersonList=new List<Person>();
Person p3=new Person(100,"James");
Person p4=new Person(200,"Smith");
Person p5=new Person(300,"Thomas");
secondPersonList.Add(p3);
secondPersonList.Add(p4);
secondPersonList.Add(p5);
setOfPersons.Add(secondPersonList);
List<Person> thirdPersonList=new List<Person>();
Person p6=new Person(100,"James");
Person p7=new Person(400,"Amy");
setOfPersons.Add(thirdPersonList);
.SelectMany(l => l.Select(l1 => l1))
.Where(g => g.Count() == setOfPersons.Count);
Console.WriteLine("These people appears in all set:");
Console.WriteLine("Id: {0} Name: {2}", a.Key, a.Count(), a.First().Name);
public Person(int id, string name) {
public int Id { get; set; }
public string Name { get; set; }