In Java ist es möglich, eine Schnittstelle mit einem dynamischen Proxy, um so etwas zu dynamisch implementieren:Was ist das .Net-Äquivalent von Java's Dynamic Proxies?
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);
}
Gibt es ein Äquivalent in .net?
Ja. Es gibt ein Framework, das diese Funktionalität bietet. –