title: c# - Searching for a combination within a list
body: <p>I have the following:</p>
  
  <pre><code>public class Address{
      public string Number { get; set; }
      public string Street { get; set; }
      public string Suburb { get; set; }
  }
  
  List&lt;Address&gt; MyAddressList = new List&lt;Address&gt;();
  
  Address MyAddress = new Address();
  myAddress.Number = "5"
  myAddress.Street = "Smith St"
  myAddress.Suburb = "Smithsville"
  MyAddressList.Add(MyAddress);
  
  Address MyAddress2 = new Address();
  myAddress2.Number = "10"
  myAddress2.Street = "John St"
  myAddress2.Suburb = "Johnsville"
  MyAddressList.Add(MyAddress2);
  
  string [] StreetToFind = new string {"Smith St"};
  string [] SuburbToFind = new string {"Smithsville"};
  string [] secondSuburbToFind = new string {"Johnsville"};
  </code></pre>
  
  <p>I want to search through this list and look for a combination of values and return a bool if the combination is found.</p>
  
  <p>To start, I can search for an individual value in the Street Property:</p>
  
  <pre><code>bool StreetIsFound = MyAddressList.Select(x =&gt; x.Street).Intersect(StreetToFind).Any();
  </code></pre>
  
  <p>and the same for Suburb:</p>
  
  <pre><code>bool SuburbIsFind = = MyAddressList.Select(x =&gt; x.Suburb).Intersect(SuburbToFind).Any();
  </code></pre>
  
  <p>but I want to be able to search for both in a combination (bool StreetandSuburbFound)</p>
  
  <p>so that if I searched for StreetToFind and SuburbToFind, StreetandSuburbFound would be true but would be false if searching for StreetToFind and secondSuburbToFind.</p>