Предполагая, что существует класс X, как описано ниже, как мне получить информацию о методе для не-общего метода? В приведенном ниже коде будет указано исключение.
using System;
class Program {
static void Main(string[] args) {
var mi = Type.GetType("X").GetMethod("Y"); // Ambiguous match found.
Console.WriteLine(mi.ToString());
}
}
class X {
public void Y() {
Console.WriteLine("I want this one");
}
public void Y<T>() {
Console.WriteLine("Not this one");
}
}