Skip to content Skip to sidebar Skip to footer

Invoke An Overloaded Generic Method On A Static Class

I'm trying to invoke methods on the InputExtensions static class in order to create overloads for the methods on the HtmlHelper class. So anyway, I still couldn't invoke the method

Solution 1:

Unfortunately, it seems that it is not possible... http://blogs.msdn.com/b/yirutang/archive/2005/09/14/466280.aspx

The only thing you can do is to iterate over all methods with given name and analyze argument types by yourself :(

Solution 2:

I believe you want:

BindingFlags.Public | BindingFlags.Static

Edit:

Try iterating over the methods in debug mode until you find the one you're looking for, then you can examine the params to make sure they all line up.

typeof(A).GetMethods().Where(m => m.IsGenericMethod); 

Post a Comment for "Invoke An Overloaded Generic Method On A Static Class"