The action simply beautifully encapsulates delegates in a simple way without explicitly declaring your delegates. In C #, a delegate is a language engine for capturing a method as a type. Type is what you need to create an extension method on ... so, simplifying back to delegates ...
public static class Extensions { public delegate void Del(); public static void Time(this Del action) {
the language will not automatically drop methods in Del, you need to explicitly do this. Methods are not a type in themselves; delegates are a mechanism for capturing them. In fact, in C #, the delegate does not match the method. This is a C # solution for creating types of method pointers.
Another thing to keep in mind: you can: -
public static class Extensions { public delegate void Del(); public delegate void Del2(); public static void Time(this Del action) {
Now your methods can be captured as many different types.
source share