title: context.SaveChanges() not updating data in SqlServer database
body: <p>When I call <code>context.SaveChanges()</code> to update a specific product, the update is not registered in the database. I do not get any runtime error either. All I notice is that my product catalog is not updated. I still see the same values. When I run the debugger I notice that the connection state of the database is closed.</p>
  
  <p>This is the class implementing the context.SaveChanges()</p>
  
  <pre><code>namespace SportsStore.Domain.Concrete
  {
     public class EFProductRepository : IProductRepository
     {
         private EFDbContext context = new EFDbContext();
  
         public IQueryable&lt;Product&gt; Products
         {
             get { return context.Products; }
         }
  
         public void SaveProduct(Product product)
         {
             if (product.ProductID == 0)
             {
                 context.Products.Add(product);
             }
  
             context.SaveChanges();
         }
     }
   }
  
  namespace SportsStore.Domain.Concrete
  {
     public  class EFDbContext : DbContext
     {
       public DbSet&lt;Product&gt; Products { get; set; }
     }
  }
  
  namespace SportsStore.Domain.Entities
  {
      public class Product
      {
  
        [HiddenInput(DisplayValue=false)]
        public int ProductID { get; set; }
  
        public string Name { get; set; }
  
        [DataType(DataType.MultilineText)]
        public string Description { get; set; }
  
        public string Category { get; set; }
  
        public decimal Price { get; set; }
      }
  }
  </code></pre>