We have a requirement where we need to generate delegate types on the fly. We need to generate delegates given the input parameters and the output. Both input and output wou
Jon's answer works fine if you're running framework 3.5 (but not everyone is).
The 2.0 answer is to use Delegate.CreateDelegate(...)
http://msdn.microsoft.com/en-us/library/system.delegate.createdelegate.aspx
A comparison of various ways to do this including Jon's Func, Delegate.CreateDelegate, DynamicMethods and various other tricks was discussed on an earlier thread:
Delegate.CreateDelegate vs DynamicMethod vs Expression
-Oisin