What I want to achieve is this:
- Declare a generic class (<T>),
- Have the “T” restricted to types that implement IMySpecialInterface<X> (where “X” is not a known type),
- And have the class inherit from a parent class.
to give an incorrect example:
public class MyClass<T> : MyParentClass where T : IMySpecialInterface<X>
{
...
}
What is the proper syntax to achieve this?
Thanks.
You can’t use generics without knowing the types, unless you created the type at runtime.
Your best fit would be:
UPDATE or could you potentially use
dynamic?