title: LINQ: multiple Where calls only uses last one?
body: <p>I'm trying to get a query going that will search multiple tags. The tags are db based and I've related them to the entity with a junction table. If I search with 1 tag, I get the correct results, but if I search with 2 tags, I only get the entities that match the second tag.</p>
  
  <p>Here's the C# code that builds the IQueryable:</p>
  
  <pre><code>  var awTable = db.Artworks.Where( aw =&gt; true );  //default get all
  
    awTable = awTable.Where( aw =&gt; (bool)aw.IsArtworkVisible  );
  
  
    foreach ( SearchTag tagToMatch in tagList )
                  {
  
                      awTable = awTable.Where( aw =&gt; aw.ArtworkName.Contains( tagToMatch.SearchTagText )
                                                 || db.SearchTag_x_Artworks.Where( stxa =&gt; stxa.SearchTagID == tagToMatch.SearchTagID )
                                                 .Select( stxa =&gt; stxa.ArtworkID ).Contains( aw.ArtworkID ) );
  
  
                  }
  </code></pre>
  
  <p>Here's the resulting SQL, which, if I plug it into a query window and set the parameter values, includes both where clauses and returns the correct list of entities. (WTF!?!?)</p>
  
  <pre><code>    {SELECT [t0].[ArtworkID], [t0].[ArtworkName], ... [t0].[MediumID]
  FROM [dbo].[Artworks] AS [t0]
  WHERE ((EXISTS(
      SELECT NULL AS [EMPTY]
      FROM [dbo].[SearchTag_x_Artwork] AS [t1]
      WHERE ([t1].[ArtworkID] = [t0].[ArtworkID]) AND ([t1].[SearchTagID] = @p0)
      )) OR ([t0].[ArtworkName] LIKE @p1)) AND ((EXISTS(
      SELECT NULL AS [EMPTY]
      FROM [dbo].[SearchTag_x_Artwork] AS [t2]
      WHERE ([t2].[ArtworkID] = [t0].[ArtworkID]) AND ([t2].[SearchTagID] = @p2)
      )) OR ([t0].[ArtworkName] LIKE @p3)) AND (([t0].[IsArtworkVisible]) = 1)
  }
  </code></pre>
  
  <p>This is kind of befuddling, any advice is appreciated. Thanks.</p>