我有一个方法的MethodBase,需要知道该方法是否是特定接口的实现。假设我有以下类:
class MyClass : IMyInterface
{
public void SomeMethod();
}
实现接口:
interface IMyInterface
{
void SomeMethod();
}
我想在运行时(使用反射)确定某个方法是否实现了IMyInterface。
MyClass.SomeMethod()
是否为IMyInterface.SomeMethod()
的显式实现吗? - Frédéric Hamidi