Class DelegateFactory

This class creates a generic method delegate from a MethodInfo signature converting the method call into a LateBoundMethod delegate call. Using this class allows making repeated calls very quickly.

Note: this class will be very inefficient for individual dynamic method calls - compilation of the expression is very expensive up front, so using this delegate factory makes sense only if you re-use the dynamicly loaded method repeatedly.

Entirely based on Nate Kohari's blog post:

public static class DelegateFactory : object

Class Members



Creates a LateBoundMethod delegate from a MethodInfo structure Basically creates a dynamic delegate instance (code) on the fly.

public static LateBoundMethod Create(MethodInfo method)

public static LateBoundMethod Create(Type type,     string methodName,     Type[] parameterTypes)


Namespace: Westwind.Utilities
Assembly: westwind.utilities.dll

© West Wind Technologies, 2019 • Updated: 06/23/19
Comment or report problem with topic