Generic constraint syntax also derived from class

I had a problem with the following: I have a generic class with a constraint that results from a non-generic interface:

public abstract class DrilldownBase<W> where W : class, IDrilldown

This code is incorrect because it considers IDrilldown to be a limitation when it is NOT. I want the DrilldownBase class to inherit from IDrilldown. What am I missing?

Thank.

+5
source share
1 answer

Do not make this part of the limitation.

The restriction should appear after the declaration of inheritance:

public abstract class DrilldownBase<W> : IDrilldown where W : class, 
+6
source

All Articles