title: Unitofwork.dbcontext.savechanges not saving to database
body: <p>I have a method that I want to generate save capabilities for an API I have developed.  How do I properly save to my db?</p>
  
  <p>The following 3 lines does not save quantityPicked and productIdPicked to my database based on my invocation of SaveChanges in ASP.NET Entity Framework.</p>
  
  <pre><code>namespace Services
  {
      public interface IUnitOfWork : IDisposable
      {
          Data.SupplyWizardsContext DBContext();
          IGenericRepository&lt;TEntity&gt; GetRepository&lt;TEntity&gt;() where TEntity : class;
          void Dispose();
          void Save();
      }
  }
  public bool UpdateOrderPicks(int orderId, int orderItemId, int quantityPicked, int productIdPicked)
  {
      var orderItem = orderItemRepository.Get(oi =&gt; oi.OrderID == orderId &amp;&amp; oi.OrderItemID == orderItemId).FirstOrDefault();
      if (orderItem != null)
      {
          orderItem.PickedQuantity = quantityPicked;
          orderItem.ProductPickedId = productIdPicked;
          unitofwork.DBContext().SaveChanges();
          return true;
      }
      return false;
  }
  
  public override int SaveChanges()
  {
      foreach (var history in this.ChangeTracker.Entries()
          .Where(e =&gt; e.Entity is IModificationHistory &amp;&amp; e.State == EntityState.Added 
              || e.State == EntityState.Modified).Select(e =&gt; e.Entity as IModificationHistory))
      {
          if (history != null)
          {
              history.DateModified = DateTime.Now;
  
              if (history.DateCreated == DateTime.MinValue)
                  history.DateCreated = DateTime.Now;
           }
  
      }
  
      int result = base.SaveChanges();
  
      return result;
   }
  
  
  
  public IGenericRepository&lt;TEntity&gt; GetRepository&lt;TEntity&gt;() where TEntity : class
          {
              if (repositories.Keys.Contains(typeof(TEntity)))
                  return repositories[typeof(TEntity)] as IGenericRepository&lt;TEntity&gt;;
  
              var repo = new GenericRepository&lt;TEntity&gt;(context);
  
              repositories.Add(typeof(TEntity), repo);
  
              return repo;
          }
  </code></pre>
  
  <p>How do I properly save quantityPicked/productIdPicked to the database using the 3rd line?</p>