Skip to content

Instantly share code, notes, and snippets.

static Type GetActionFuncType (int count, bool func)
{
if (func) {
switch (count) {
case 1: return typeof (Func<>);
case 2: return typeof (Func<,>);
case 3: return typeof (Func<,,>);
case 4: return typeof (Func<,,,>);
case 5: return typeof (Func<,,,,>);
case 6: return typeof (Func<,,,,,>);