title: Avoid iterating with a Join (LinQ)
body: <p>Not the best title here, I know. </p>
  
  <p>The thing I have this code and it looks awful. Is there a better way to write this?</p>
  
  <pre><code>foreach (Agency agency in local.Agencies.GetAll().Where(a =&gt; a.Active).Where(a =&gt; a.Mandatory))
  {
      if (agencies.Where(a =&gt; a.AgencyId == agency.Id).Any())
      {
          mandatoryFound = true;
          break;
      }
  }
  </code></pre>
  
  <p>So  <code>local</code> is my EF context, and <code>agencies</code> is a list sent by the client. I need to check if in that list sent by the there's at least one mandatory Agency.</p>