I\'m not really sure how to title this question but basically I have an interface like this:
public interface IFoo
{
string ToCMD();
}
a co
I am not quite sure if this is what you are looking for but perhaps what you want to do is scrap the interface all together and do this:
abstract class Base
{
public abstract string ToCMD();
}
abstract class Foo : Base { }
abstract class Bar : Base { }
Hopefully you have other members in the Foo
and Bar
classes! This will allow you to either restrict your custom collection by Base
or just use a plain List
.