title: LIKE query in Entity Framework with SQL Server Compact 4.0
body: <p>I'm having the following problem with a EF CodeFirst query using SQL Server Compact as the backend.</p>
  
  <p>The LINQ expression is:</p>
  
  <pre><code>var results = (from c in x.Countries where c.Name.StartsWith(term) select c);
  </code></pre>
  
  <p>According to what I've found, the output should use a LIKE operator in the WHERE clause, but instead the SQL being run is:</p>
  
  <pre><code>SELECT [Extent1].[ID] AS [ID], [Extent1].[Name] AS [Name]
  FROM [Countries] AS [Extent1]
  WHERE (CHARINDEX(@p__linq__0, [Extent1].[Name])) = 1
  </code></pre>
  
  <p>What is going on?</p>
  
  <p><strong>EDIT:</strong> I also tried using Contains(term), the generated SQL is different, but it doesn't use LIKE either</p>