Closing an Anonymous Method to a Known Delegate Type

If you are using extension methods as a way to achieve more language oriented programming, there are lots of times you will want to be able to run extension methods against an anonymous method, but you will first have to close it to a well known delegate type before it is allowed. Here is a useful method if you want the starting point to be an anonymous method created on the fly:

public class CreateDelegate


public static DelegateType of(DelegateType body) {

return body;



Develop With Passion!