title: ASP.NET MVC Razor View, not correctly showing Linq to SQL related entities
body: <p>I'm using Linq to SQL in an ASP.NET MVC3 project with Razor views.</p>
  
  <p>My L2S objects seem to work fine in controller/model code; I can reference and work with child class collections for my related objects. However, I am unable to do so in my Razor views. Intellisense recognizes the child class collection:</p>
  
  <pre><code>Model.ChildObjects
  </code></pre>
  
  <p>But it is unable to provide any code completion for the <code>ChildObjects</code> object itself. Trying to use the collection as a collection like so:</p>
  
  <pre><code>foreach(var item in Model.ChildObjects)
  </code></pre>
  
  <p>results in the following inline error in the editor:</p>
  
  <pre><code>foreach statement cannot operate on variables of type
  System.Data.Linq.EntitySet&lt;ChildObjectType&gt; because 
  System.Data.Linq.EntitySet&lt;ChildObjectType&gt; does not
  contain a public definition for 'GetEnumerator'
  </code></pre>
  
  <p>There seems to be something wrong with what is being referenced from the Razor view. When I try to use code like this:</p>
  
  <pre><code>@Model.ChildObjects.Count()
  </code></pre>
  
  <p>I get this compilation error upon executing:</p>
  
  <pre><code>The type 'System.Data.Linq.EntitySet`1&lt;T0&gt;' is defined in an assembly that is
  not referenced. You must add a reference to assembly 
  'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
  </code></pre>
  
  <p>I haven't changed anything in the <code>web.config</code> file(s) for the project. I have recently updated my Windows 7 to SP1, and updated my NuGet... but I'm not sure if there would be anything involved there.</p>