Frage

Ich möchte, dies tun können.

MyInterface interface = new ServiceProxyHelper<ProxyType>();

Hier ist die Objektstruktur

MyTypeThatImplementsMyInterface : MyInterface

Wird diese Arbeit?

public class ProxyType : MyInterface {}

public class ServiceProxyHelper<ProxyType> : IDisposable, MyInterface {}
War es hilfreich?

Lösung

Ich denke, das ist das, was Sie zu tun versuchen:

public class ServiceProxyHelper<T> where T : MyInterface { ... }
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top