开发者

Constraint syntax with generics, also deriving from a class

I'm having a heck of an issue with the following: I have a generic class, with a constraint, that derives from a non-generic interface:

public abstract class DrilldownBase<W&开发者_开发百科gt; where W : class, IDrilldown

This code is not correct through, because it thinks IDrilldown is a constraint, when its NOT. What I want is for the class DrilldownBase to inherit from IDrilldown. What am I missing?

Thanks.


Don't make it part of the constraint then.

The constraint should come after the inheritance declaration:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜