什么是Java的Dynamic Proxies的.Net等价物?

java中,可以使用动态代理动态实现接口,如下所示:
public static <T> T createProxy(InvocationHandler invocationHandler,Class<T> anInterface) {
    if (!anInterface.isInterface()) {
        throw new IllegalArgumentException("Supplied interface must be an interface!");
    }
    return (T) Proxy.newProxyInstance(anInterface.getClassLoader(),new Class[]{anInterface},invocationHandler);
}

.Net中有等价物吗?

解决方法

有几个库在.NET中实现这一点. Here’s a list of them,有基准.

相关文章

最近看了一下学习资料,感觉进制转换其实还是挺有意思的,尤...
/*HashSet 基本操作 * --set:元素是无序的,存入和取出顺序不...
/*list 基本操作 * * List a=new List(); * 增 * a.add(inde...
/* * 内部类 * */ 1 class OutClass{ 2 //定义外部类的成员变...
集合的操作Iterator、Collection、Set和HashSet关系Iterator...
接口中常量的修饰关键字:public,static,final(常量)函数...