How can I write a generic container class that implements a given interface in C#?
Context: .NET 3.5, VS2008. I'm not sure about the title of this question, so feel free to comment about the title, too :-) Here's the scenario: I have several classes, say Foo and Bar, all of them implement the following interface: public interface IStartable { void Start(); void Stop(); } And now I'd like to have a container class, which gets an IEnumerable<IStartable> as an argument in its constructor. This class, in turn, should also implement the IStartable interface: public class StartableGroup : IStartable // this is the container class { private readonly IEnumerable<IStartable>