title: Declare Generic static method in C#
body: <p>Is there any way to declare a generic static method in C#?<br>
  For example:</p>
  
  <pre><code>public static class Class&lt;T,P&gt; 
      where T:class
      where P:class
  {
  
      public static T FromTtoP (this P ob)
      {
      ...
      }
  
  }
  </code></pre>
  
  <p>this code does not work .
  I want to map from DTO to DAL and and vice-versa. </p>
  
  <p>I have tried making the class non-generic</p>
  
  <pre><code>public static class Class
  {
  
      public static TDTO MapToDTO&lt;TDTO, TDAL&gt;(this TDAL dal)
                  where TDTO : class
                  where TDAL : class
              {
  
              }
  }
  </code></pre>
  
  <p>I get an error message from "this".</p>