title: Static Methods vs Class Instances and return values in C#
body: <p>I have various classes for handling form data and querying a database. I need some advice on reducing the amount of code I write from site to site.</p>
  
  <p>The following code is for handling a form posted via ajax to the server. It simply instantiates a Form class, validates the data and processes any errors: </p>
  
  <pre><code>public static string submit(Dictionary&lt;string, string&gt; d){
  
      Form f = new Form("myform");
  
      if (!f.validate(d)){
  
          return f.errors.toJSON();
  
      }
  
      //process form...
  
  }
  </code></pre>
  
  <p>Is there a way to reduce this down to 1 line as follows:</p>
  
  <pre><code>if (!Form.validate("myform", d)){ return Form.errors.toJSON(); }
  </code></pre>