Action returning void and taking parameter, with ternary operator
<p>I want to write an Action which only takes a PerformanceCounterCategory as a parameter. I know there is Action&lt;>, Func&lt;> and Delegates and there is some distinction between these, but I am not sure what it is. Can someone please tell me what the difference is (I read somewhere that Action does not return, or this may be Func).</p>

<p>I am trying to write something like the following:</p>

<pre><code>Action&lt;PerformanceCounterCategory&gt; action = (int &gt; 5) ? action1 : action2;
</code></pre>

<p>action1 and action2 are both methods which return void but take PerformanceCounterCategory as the (only) parameter.</p>

<p>Is this the right way to go? I keep getting errors about method group/void etc so I am not confident the code above is the best for my needs.</p>

<p>Thanks</p>
