title: Entity Framework seems to be caching data
body: <p>My issue is that when I write a basic EF query to get data from the database, it retrieves the data fine, but when I change the data in the SQL Server database and reload the query, I get the same dataset back, instead of the new data. And it takes a while for the data to be the amended information.</p>
  
  <pre><code>var mm = o.GetContent(page, title);
  </code></pre>
  
  <p>The above query, for example, would bring back</p>
  
  <pre><code>mm.Body = "Test";
  </code></pre>
  
  <p>Then if I change <code>Body</code> within the SQL Server database to <code>Test1</code> and reload the query, it doesn't bring back <code>Test1</code>.</p>
  
  <pre><code>public String GetContent(String page, String title)
  {
      var o = new DataContext();
  
      var mm = o.GetContent(page, title);
  
      return HttpUtility.HtmlDecode(mm.Body);
  }
  
  public class DataContext
  {
      private static ApplicationDbContext Da = new ApplicationDbContext();
  
      public Content GetContent(String page, String title)
      {
          return Da.Content.SingleOrDefault(c =&gt; c.Page == page &amp;&amp; c.Title == title);
      }   
  }
  </code></pre>
  
  <p>I've visited a number of SO posts:</p>
  
  <p><a href="https://stackoverflow.com/questions/10011780/prevent-caching-in-asp-net-mvc-for-specific-actions-using-an-attribute">Prevent Caching in ASP.NET MVC for specific actions using an attribute</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12948156/asp-net-mvc-how-to-disable-automatic-caching-option">ASP.NET MVC how to disable automatic caching option?</a></p>