title: Entity Framework not flushing data to the database
body: <p>I am using Visual Studio 2012.  I have a very simple Products table in a Local Database (cleverly named Database1).  It has two fields: id and Name. I preloaded it with a few test data.</p>
  
  <p>The following code should update the Name of the first Product.  Internally, it does.  I can retrieve all Products and see that the first one's Name is "Shirt."  But the change is never flushed to the database.  The record is never updated.  Examining the database reveals that the name has not been changed. </p>
  
  <p>My question is simple: Why are changes not being sent to the database?</p>
  
  <pre><code>using (var context = new Database1Entities())
  {
      var products = context.Products;
  
      products.First().Name = "Shirt";
      context.SaveChanges();
  }
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <p>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</p>
  
  <p>EDIT:</p>
  
  <p>I tried my best to enter the full code and output here.  But, no matter what I do, I continue to get the "Your post appears to contain code that is not properly formatted" error message.  After 30 minutes I am giving up.</p>
  
  <p>EDIT: </p>
  
  <p>The code and output is here: <a href="http://pastebin.com/GmQtwAND" rel="nofollow">http://pastebin.com/GmQtwAND</a></p>