title: Using linq to check if list contains x and y together
body: <p><img src="https://i.stack.imgur.com/8iXx7.png" alt="enter image description here">Say I have a list that contains values "x", "y" and "z". I want to check if it contains "x" or ("y" and "z").</p>
  
  <p>I tried using the <code>Any</code> extension method but I don't think I m doing it right.</p>
  
  <pre><code>Dim retValue As Boolean = userRoles.Any(Function(a) (a.Name.ToLower() = "x") _ 
      OrElse (a.Name.ToLower() = "y" AndAlso a.Name.ToLower() = "z"))
  </code></pre>
  
  <p>Can someone suggest how it can be done?</p>
  
  <p>Note: Added the roleList. It contains 3 values General.Alien, General.Employee and Internal.External.</p>
  
  <p>Now i need to check if my list contains either (general.alien and internal.external) or general.employee.</p>