title: Why doesn't Entity Framework add a "where" to the SQL generated when SingleOrDefault is used?
body: <p>I'm using Entity Framework CTP 5 with "code only" (with SQL Server 2008). I have an entity returned from a DbContext that I then access a child collection from, and select one item from it. Here's my LINQ statement:</p>
  
  <pre><code>Question currentQuestion = currentTopic.Questions.SingleOrDefault(x =&gt; x.IsCurrent);
  </code></pre>
  
  <p>This produces the following SQL:</p>
  
  <pre><code>SELECT 
  [Extent1].[Id] AS [Id], 
  [Extent1].[CreatedAt] AS [CreatedAt], 
  [Extent1].[IsCurrent] AS [IsCurrent], 
  [Extent1].[Xml] AS [Xml], 
  [Extent1].[TopicId] AS [TopicId]
  FROM [dbo].[Questions] AS [Extent1]
  WHERE [Extent1].[SessionId] = 24
  </code></pre>
  
  <p>My "IsCurrent" restriction isn't referenced at all. IsCurrent is a bit field in my database.</p>
  
  <p>Can anyone explain why this is? It's causing a huge performance hit.</p>