title: providing a similarly named static and non-static method in C#
body: <p>I apologize if this is a repeat. But I am wondering if it is wise in some situations to provide a method that has both a static and non-static version. (Non-static version provided through Extension.) I just created such a thing, but I'm wondering if I should have in the first place.</p>
  
  <p>Take the following as an example:</p>
  
  <pre><code>public class MyClass
  {
      public Dictionary&lt;string, string&gt; Dict {get; private set;}
  
      public MyClass(Dictionary&lt;string, string&gt; dict) { this.Dict = dict; }
  
      public static DataTable CreateTable(MyClass data)
      {
          DataTable result = new DataTable();
          foreach (string column in data.Dict.Keys)
          {
              result.Columns.Add(column, typeof(string));
          }  
          DataRow dr = result.NewRow();
          foreach (string column in data.Dict.Keys)
          {
              dr[column] = data.Dict[column];
          } 
          return result;
      }  
  }
  
  public static class MyClassExtension
  {
      public static DataTable CreateTable(this MyClass data)
      {
          return MyClass.CreateTable(data);
      }
  }
  </code></pre>
  
  <p>Doing this will allow person to use 
  <code>MyClass.CreateTable(new MyClass(a dictionary object));</code> 
  or </p>
  
  <pre><code>List&lt;MyClass&gt; cs = new List&lt;MyClass&gt;();
  Dictionary&lt;string,string&gt; d;
  MyClass c;
  
  d = new Dictionary&lt;string,string&gt;() {{"First Name", "John"}, {"Last Name", "Doe"}, {"ID", "123-1234-123"}};
  c = new MyClass(d);
  cs.Add(c);
  
  d = new Dictionary&lt;string,string&gt;() {{"First Name", "Jack"}, {"Last Name", "Mare"}, {"ID", "123-1234-124"}};
  c = new MyClass(d);
  cs.Add(c);
  
  d = new Dictionary&lt;string,string&gt;() {{"First Name", "Jill"}, {"Last Name", "Hen"}, {"ID", "123-1234-126"}};
  c = new MyClass(d);
  cs.Add(c);
  
  DataTable dt = new DataTable();
  foreach (MyClass ct in cs)
  {
      dt.Merge(ct.CreateDataTable(), false, MissingSchemaAction.Add);
  }
  </code></pre>
  
  <p>Obviously, my application of the class is slightly more complicated than this. Also, even though I have this set up as a Dictionary -> DataTable conversion, I suppose one could do a DataTable -> Dictionary conversion.  That's not the point of the question, though.</p>