title: Entity Framework SaveChanges within extended partial of an EntityObject
body: <p>I'm extending the partial that was autogenerated to change the status flag of a row on the database. Right now I've got it working, but I need to call <code>db.SaveChanges()</code> from outside of the partial. Is there a way that I can get the current Entities context from within the partial in order to have it save the change immediately?</p>
  
  <pre><code>public partial interface IMyEntityStatusChange
  {
      void ChangeStatus(MyEntityStatusCode code);
  }
  
  public partial class MyEntity : IMyEntityStatusChange
  {
      public void ChangeStatus(MyEntityStatusCode code)
      {
          StatusCode = (int)code;
          //Now I want to Save it to the db
      }
  } 
  </code></pre>
  
  <p>Right now I have To do something like this:</p>
  
  <pre><code>using(var db = new EFEntities())
  {
      db.MyEntities.FirstorDefault().ChangeStatus(MyEntityStatusCode.Failed);
      db.SaveChanges();
  }
  </code></pre>
  
  <p>Thank you!</p>