title: Optional Function Parameter
body: <p>In C# I have the following function definition:</p>
  <pre><code>public static TResult SomeParentFunctionName&lt;TSource, TResult&gt;(
      TSource SomeValue,
      Func&lt;TSource, TResult&gt; ChildFunction1,
      Func&lt;TSource, TResult&gt; ChildFunction2)
  </code></pre>
  <p>This function takes <code>SomeValue</code> and then calls <code>ChildFunction1</code> and <code>ChildFunction2</code></p>
  <p>According to my business rules, I <strong>always</strong> need to run <code>ChildFunction1</code>, but only <strong>sometimes</strong> need to run <code>ChildFunction2</code>.</p>
  <p>Can I make <code>ChildFunction2</code> an optional parameter? How do I go about doing that? And how do I know if it has been passed in.</p>
  <h2>Options I have considered:</h2>
  <ol>
  <li><p>I could create two <code>SomeParentFunctionName</code> functions, one with <code>ChildFunction2</code> and one without.</p>
  </li>
  <li><p>I could pass in a blank function that just won't do anything - but that's not good practice.</p>
  </li>
  </ol>