How to make a class interface Require an implementation of IEnumerable

181 Views Asked by At

I simply need to know the "requires" syntax for a C# class interface. If I have a class like this:

public interface IGroupNode : ISceneNode

How can I make the interface require the implementation of IEnumerable? I think this is very simple and just a syntax thing, but feel free to prove me wrong.

Update:

public interface IGroupNode : ISceneNode, IEnumerable<ISceneNode>

Now I'm confused on where to implement IEnumerable? I have no concrete class implementation of ISceneNode. Should I do it in the concrete class implementation of IGroupNode instead?

2

There are 2 best solutions below

5
On BEST ANSWER
public interface IGroupNode : ISceneNode, IEnumerable

Just like you did with your other interface.

0
On
public interface IGroupNode : ISceneNode, IEnumerable