title: Duplicate rows in linq query
body: <p>I've got view <code>vw_AllNomenLost</code> in my database</p>
  
  <pre><code>SELECT     TOP (100) PERCENT ProducerName, NomenCode, SUM(ErrorCount) AS ErrorCount
  FROM         dbo.NomenLost
  GROUP BY ProducerName, NomenCode
  ORDER BY ErrorCount DESC
  </code></pre>
  
  <p>and I added it to Entity Model.</p>
  
  <p>I want to get top 10 rows by Producer and sorted by <code>ErrorCount</code></p>
  
  <pre><code>db.vw_AllNomenLost.Where(a =&gt; a.ProducerName == producer).OrderByDescending(a =&gt; a.ErrorCount).Take(10);
  </code></pre>
  
  <p>In the debugger I get :</p>
  
  <pre><code>SELECT TOP (10) 
      [Project1].[NomenCode] AS [NomenCode], 
      [Project1].[ProducerName] AS [ProducerName], 
      [Project1].[ErrorCount] AS [ErrorCount]
      FROM ( 
      SELECT 
          [Extent1].[ProducerName] AS [ProducerName], 
          [Extent1].[NomenCode] AS [NomenCode], 
          [Extent1].[ErrorCount] AS [ErrorCount]
          FROM (
  
      SELECT  
  [vw_AllNomenLost].[ProducerName] AS [ProducerName], 
  
          [vw_AllNomenLost].[NomenCode] AS [NomenCode], 
  
          [vw_AllNomenLost].[ErrorCount] AS [ErrorCount]
      FROM [dbo].[vw_AllNomenLost] AS [vw_AllNomenLost]) AS [Extent1]
          WHERE ([Extent1].[ProducerName] = @p__linq__0) AND (@p__linq__0 IS NOT NULL)
  
  
      )  AS [Project1]
      ORDER BY [Project1].[ErrorCount] DESC
  </code></pre>
  
  <p>If I execute </p>
  
  <pre><code>SELECT     TOP (10) *
  FROM        vw_AllNomenLost
  where ProducerName = @producer
  Order by ErrorCount desc
  </code></pre>
  
  <p>In Management Studio, I get a correct result. but my linq query returns some duplicate rows. </p>
  
  <pre><code>NomenCode   ErrorCount
  31190RRAA00  11
  31190RRAA00  11
  31190RRAA00  11
  31190RRAA00  11 
  </code></pre>
  
  <p>How is it possible? I don't get it. What did I do wrong?  Thank you very much for reading and sorry for too long question.</p>