title: Entity Framework 4 issue
body: <p>Using .NET Web API (.NET 4, EF 4) and I'm getting some strange errors when debugging and really can't figure what is going on.</p>
  
  <p>Say in the <code>DocumentRepository</code> I have this constructor:</p>
  
  <pre><code>public DocumentRepository(DocPortalContext db)
  {
      this._db = db;
  }
  </code></pre>
  
  <p>If I debug and hover over <code>_db</code> and drill into the items in the popup window I'm coming across the following errors:</p>
  
  <blockquote>
    <p>System.Data.Entity.Infrastructure.IObjectContextAdapter.ObjectContext = 'System.Data.Entity.DbContext' does not contain a definition for 'System' and no extension method 'System' accepting a first argument of type 'System.Data.Entity.DbContext' could be found (are you missing a using directive or an assembly reference?)</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>System.Collections.Generic.ICollection>.IsReadOnly = 'System.Collections.Generic.Dictionary' does not contain a definition for 'System' and no extension method 'System' accepting a first argument of type 'System.Collections.Generic.Dictionary
  </blockquote>
  
  <p><em>No exceptions are being caught.</em></p>
  
  <p>If I put a break point on this line in a repository method - <code>return  _db.Documents.AsQueryable();</code> - and hover over <code>Document</code> I get the following error:</p>
  
  <blockquote>
    <p>System.Linq.IQueryable.Provider = 'System.Data.Entity.Infrastructure.DbQuery' does not contain a definition for 'System' and no extension method 'System' accepting a first argument of type 'System.Data.Entity.Infrastructure.DbQuery' could be f...</p>
  </blockquote>
  
  <p>Some help would be much appreciated.</p>
  
  <p><strong>Additional information:</strong></p>
  
  <p>Drilling into <code>_db</code> in the following way gives message quoted at the end:</p>
  
  <blockquote>
    <p>base(System.Data.Entity.DbContext) -> Internal Context -> _appConfig -> and finally Default Connection Factory has the following error beside it "The function evaluated requires all threads to run."</p>
  </blockquote>
  
  <p><strong>More information as per my comment:</strong></p>
  
  <p>This isn't really related to the question, but it has me thinking there could be something wrong with my install of .NET or VS - I don't know enough about the pipework to make that call, maybe one of you can. Anyway, I can browse to a URI in my WebAPI project and get JSON returned in the browser. When I try to consume the URI in my Website project, I get this in my browser: <code>Could not find file 'C:\Program Files (x86)\IIS Express\System.Net.Http.StreamContent'.</code> which is also caught as an exception. </p>