Here is a case that is pretty hard to get right:
public interface IAmGeneric<T> { void SoAmI<T1, T2>(T one, T1 two, T2 three); void SoAmI<T1, T2>(T one, T2 two, T1 three); void SoAmI<T1, T2>(T1 one, T two, T2 three); void SoAmI<T1, T2>(T2 one, T1 two, T three); void SoAmI<T1, T2, T3>(T2 one, T1 two, T3 three); }
For me, the solution is to use GetMethods(...).Select() and compare the method name, number of parameters, types and type parameters to find the correct method (basically everything that is part of the method signature).
Julien Roncaglia
source share