title: Extend EF DBContext
body: <p>I am not sure if what i am asking is the way to go. I have a DB first model. I want to add certain common methods to it, like updating a specific field of a specific table. </p>
  
  <p>I know i could do this by creating a class with the appropriate methods like:</p>
  
  <pre><code>public static class MyClass
  {
      public static void UpdateFieldAOfTableA(int newValue)
      {
          using(DBContext db = new DBContext())
          {
              //Update Code
              db.SaveChanges();
          }
      }
  }
  </code></pre>
  
  <p>But is there a way of extending the DBContext, so i could just call:</p>
  
  <pre><code>DBContext.UpdateFieldAOfTableA(newValue);
  </code></pre>
  
  <p>I tried creating a partial class and adding an extension such as:</p>
  
  <pre><code>public partial class DBContext
  {
      public static void UpdateFieldAOfTableA(this DBContext db,int newValue)
      {
          //Update Code here
      }
  }
  </code></pre>
  
  <p>but this obviously didn't work as i can extent only non-generic static classes and this is not static.</p>
  
  <p>Do you think what i am trying to do is wrong? What are your thoughts?</p>