Imagine type like this (C#):
public interface IAmGeneric<T>
{
void SoAmI<T1>(T one, T1 two);
}
Given I have open generic MethodInfo
from open generic version of the type (IAmGeneric<>.SoAmI<>()
) and the following array
new[] { typeof(int), typeof(string) }'
I'm looking for well performing and reliable way of getting closed version of the MethodInfo
like this:
IAmGeneric<int>.SoAmI<string>()
UPDATE:
by reliable I mean it should handle cases when the method is no public, has dozen overloads, uses generic arguments from base type, not just its immediate interface etc.