title: Exiting a method in C#
body: <p>In C++ if I want to exit a method without returning anything I can do; </p>
  
  <pre><code>// A completely useless method
  static public double function(int a){
    if(a==1){
       cout &lt;&lt; "Error !";
       exit(1);
    }
    else
       return (double)a;       
  }
  </code></pre>
  
  <p>How can I do the equivalent in C# ?</p>