title: How to have a LINQ to SQL query use an index containing a BIT column on SQL Server Compact?
body: <p>I'm using the following LINQ to SQL query on a SQL Server Compact DB ...</p>
  
  <pre><code>from article in context.OutboundArticles
  where !article.IsDeleted
  select article
  </code></pre>
  
  <p>... which generates the following SQL:</p>
  
  <pre><code>SELECT [t0].[Id], [t0].[Text], [t0].[IsDeleted]
  FROM [OutboundArticle] AS [t0]
  WHERE NOT ([t0].[IsDeleted] = 1)
  </code></pre>
  
  <p>This would be perfectly fine if it weren't for the fact that there's an index on the IsDeleted column and SQL Server Compact will not use the index unless the SQL looks like this:</p>
  
  <pre><code>SELECT [t0].[Id], [t0].[Text], [t0].[IsDeleted]
  FROM [OutboundArticle] AS [t0]
  WHERE [t0].[IsDeleted] = CONVERT(BIT, 0)
  </code></pre>
  
  <p>So the question is: How do I convince LINQ to SQL to generate the "CONVERT(BIT, 0)"? I've already tried the following ...</p>
  
  <pre><code>from article in context.OutboundArticles
  where article.IsDeleted == Convert.ToBoolean(0)
  select article
  </code></pre>
  
  <p>... but the generated SQL looks the same.</p>