promposive
Senior member
Is there a way to allow access to a Type's methods without implementing some kind of interface like I have defined?
The problem is I have a class that I am trying to use generics on, and I need access to one of the methods on the given type(s) (the method will exist on all the types supported by this class).
My only solution so far is to make all the Type's that would be passed into as IObjectServerType implement an interface, ITestInterface. It seems weird though, considering the IObjectServerType's are already interfaces...
I am new to generics, but I am guessing an interface is the only way to do it. Mainly just asking to see if there is anything else because that would be extremely useful. 🙂
Edit:
The code block isnt working right?
The problem is I have a class that I am trying to use generics on, and I need access to one of the methods on the given type(s) (the method will exist on all the types supported by this class).
My only solution so far is to make all the Type's that would be passed into as IObjectServerType implement an interface, ITestInterface. It seems weird though, considering the IObjectServerType's are already interfaces...
I am new to generics, but I am guessing an interface is the only way to do it. Mainly just asking to see if there is anything else because that would be extremely useful. 🙂
Edit:
The code block isnt working right?