I'm stumped on this one right now.
What I have: public abstract class Class1<T> where T : SomeBaseClass, new()
I want Class1 to inherit from: public abstract class Class2
. How can I do this? Can I do this?
The inherited class comes before the where
clause.
public abstract class Class1<T> : Class2 where T : SomeBaseClass, new()
See also the MSDN page on Generic Classes.
You just put the base class in before the template constraint.
public abstract class Class1<T> : Class2 where T : SomeBaseClass, new()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With