title: Using union inside a foreach loop for linq to sql
body: <p>In the below code I expect to retrn n rows but it always returns zero rows as my initial set has zero records. Ideally it should be doing a UNION ALL and returning me records for all of the integers in the integer list clearanceTotals{6,7,8,9,17}
  Any idea how to go about it?</p>
  
  <pre><code>    var tbl = (from a in db.Applicants
      where a.Id == null
      select new { a.Id, a.Firstname, a.Lastname });
      int thisTag;
      foreach (int c in clearanceTotals)
      {
          switch (c)
          {
              case 6:
                  thisTag = 38;
                  break;
              case 8:
                  thisTag = 39;
                  break;
              case 17:
                  thisTag = 39;
                  break;
              case 7:
                  thisTag = 42;
                  break;
              case 9:
                  thisTag = 44;
                  break;
          }
          tbl = (from a in db.Applicants
                 join ad in db.ApplicantDeployments on a.Id equals ad.ApplicantId
                 join aa in db.ApplicantAttachments on a.Id equals aa.ApplicantId
                 where a.Nationality == 15 &amp;&amp; a.DoNotUse == false &amp;&amp; a.ClearanceStatus == c
                 &amp;&amp; aa.Tag == thisTag
                 select new { a.Id, a.Firstname, a.Lastname }).Union(tbl);
      }
  </code></pre>