title: EF4 returns incorrect values when selecting from summary view
body: <p>I am using EF4 to read data from a view .This is a  summary view with group by etc and is readonly-it does not have a primary key. So inorder to make it import into EF4 I used an often suggested  trick -ie use ISNULL(column,-11) as the first column in the view. This helps EF4 to infer primary key and  import the view. </p>
  
  <p>However when I select from the view in EF4 very strange thing happens - I get incorrect data as compared to when I directly select from the view in Management studio. I could not believe this so I tried a few times and the error persisted. Just to make sure I created a table in SQL Server by select all from the view and accessed the table in  EF4 .But then in returns correct data!</p>
  
  <p>The view is not very complicated except that it is a summary view (group by with joints) and it uses a SQL Common table expression(ie the with clause).</p>
  
  <pre><code>When I select straight in database using select * from vw_responserate I get 
  
  coltext       SurveyId  rowtext1    rowtext2            cnt
  Anwender    2   Angestellte/r   Französische Schweiz    1
  Anwender    2   Angestellte/r   Italienische Schweiz    1
  IT Spezialist   2   Angestellte/r   Deutsche Schweiz    1
  IT Spezialist   2   Mittleres Management / Senior Management    Italienische Schweiz    1
  
  When I select from EF4 I get
  
  coltext rowtext1 rowtext2 cnt
  Anwender      Angestellte/r Französische Schweiz 1
  Anwender      Angestellte/r Französische Schweiz 1
  IT Spezialist Angestellte/r Deutsche Schweiz 1
  IT Spezialist  Angestellte/r Deutsche Schweiz 1
  </code></pre>
  
  <p>Any help would be appreciated</p>
  
  <p>thanks</p>