我有一个方法的MehtodBase,我需要知道该方法是否是特定接口的实现.所以,如果我有以下课程:
class MyClass : IMyInterface
{
public void SomeMethod();
}
Run Code Online (Sandbox Code Playgroud)
实现界面:
interface IMyInterface
{
void SomeMethod();
}
Run Code Online (Sandbox Code Playgroud)
我希望能够在运行时(使用反射)发现某个方法是否实现了IMyInterface.