title: Convert System.Data.Entity.DynamicProxies to (non proxy) class in C#
body: <p>I am getting some data from the database and storing this in a global variable as shown:</p>
  
  <pre><code>//Global Variable
  public static List&lt;stuff&gt; Stuff;
  
  using (var context = new StuffContext()) 
  { 
      stuff = new List&lt;stuff&gt;();
      stuff = (from r in context.Stuff
                  select r).ToList(); 
  }
  </code></pre>
  
  <p>The problem I am having is that the context closes and when I wish to access some of the data stored in the global variable, I cannot. </p>
  
  <p>The data is of System.Data.Entity.DynamicProxies.Stuff instead of Application.Model.Stuff which means I then receive this error when I try to do something with the data:</p>
  
  <pre><code>"The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."
  </code></pre>
  
  <p>My question is how can I, using the above code as an example, convert / cast to the type that I want so that I can use the data else where in my application?</p>
  
  <p>Edit: Quick screen grab of the error:
  <a href="https://i.stack.imgur.com/Dlub4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Dlub4.png" alt="enter image description here"></a></p>