1
public class Info
{
    public List<string> Projects { get; set; }
    public List<string> Schools { get; set; }
    public List<string> Locations { get; set; }
    public List<string> Interests { get; set; }
    public List<string> Hobbies { get; set; }
}

To intersect 2 lists, you can just do this: list1.Select(a => a.Projects).Intersect(list2.Select(b => b.Projects));

But what if you want to have maybe an third object with the common strings let's say from the first two objects?

Gerald Hughes
  • 5,189
  • 18
  • 70
  • 115

1 Answers1

2

Simplest solution I can think of is Cascading Intersection:

var result = Projects.Intersect(Schools)
                     .Intersect(Locations)
                     .In‌​tersect(Interests​)
                     .Intersect(Hobbies)
                     .ToList();
Mrinal Kamboj
  • 11,000
  • 4
  • 34
  • 64