tags:

views:

258

answers:

2

I want to be able to do this.

MyInterface interface = new ServiceProxyHelper<ProxyType>();

Here's the object structure

MyTypeThatImplementsMyInterface : MyInterface

Will this work?

public class ProxyType : MyInterface {}

public class ServiceProxyHelper<ProxyType> : IDisposable, MyInterface {}
+3  A: 

I think this is what you're trying to do:

public class ServiceProxyHelper<T> where T : MyInterface { ... }
John
Yah, that's what I'm trying to do, thanks!
A: 

Related question:
Create Generic method constraining T to an Enum

Nescio