using System.Collections.Generic;
private static TResult Foo<TResult>(Delegate f, params object[] args)
object result = f.DynamicInvoke(args);
return (TResult)Convert.ChangeType(result, typeof(TResult));
public static bool Method(string name, int age)
if (name == "Jon" && age == 40)
public static void Main()
var method = (Func<string, int, bool>)Method;
Console.WriteLine(Foo<bool>(method, "Jon", 40));
Console.WriteLine(Foo<bool>(method, "yoyo", 22));