title: How can you use optional parameters in C#?
body: <p><sup><strong>Note:</strong> This question was asked at a time when C# did not yet support optional parameters (i.e. before C# 4).</sup></p>
  
  <p>We're building a web API that's programmatically generated from a C# class. The class has method <code>GetFooBar(int a, int b)</code> and the API has a method <code>GetFooBar</code> taking query params like <code>&amp;a=foo &amp;b=bar</code>. </p>
  
  <p>The classes needs to support optional parameters, which isn't supported in C# the language. What's the best approach?</p>