does "linq where" not resolve properties?
<p>I have an IQueryable (PartHistories) that will return a set of objects. I have an enum called Phase that alters the query, like this (rc is a list):</p>

<pre><code>            var query = this.PartHistories;
            if ( Phase.Repair == _Phase )
            {
                query = query.Where( ph =&gt; ph.RemovedInRepair == false );
            }
            else
            {
                query = query.Where( ph =&gt; ph.PartPhaseID != ( int )Phase.Repair );
            }
            rc.AddRange( query
                .ToList( ) );
</code></pre>

<p>This works.</p>

<p>Now, the object in question (PartHistory) has a property, PartPhase, which casts PartPhaseID as Phase.  This code, however, does NOT work (the change is in the Phase.Repair line):</p>

<pre><code>            var query = this.PartHistories;
            if ( Phase.Repair == _Phase )
            {
                query = query.Where( ph =&gt; ph.RemovedInRepair == false );
            }
            else
            {
                query = query.Where( ph =&gt; ph.PartPhase != Phase.Repair );
            }
            rc.AddRange( query
                .ToList( ) );
</code></pre>

<p>At the AddRange, the exception is "the member 'PartPhase' is not supported.</p>

<p>Finally, the following code works, but in this case, the Where is the extension of List and (I think) applies after all the PartHistories have been collected:</p>

<pre><code>          if( Phase.Repair == _Phase )
          {
              rc.AddRange( this.PartHistories.ToList( )
                  .Where( ph =&gt; ph.RemovedInRepair == false ) );
          }
          else
          {
              rc.AddRange( this.PartHistories.ToList( )
                  .Where( ph =&gt; ph.PartPhase != Phase.Repair ) );
</code></pre>
