This is probably me just remembering things completely backwards, but I'd like to know more about what I'm doing wrong...
I have declared a class to be nothing more than a direct inheritance from a generic list (done to simplify naming), something like this:
public class FooList : List<Foo> {}
now in another method completely separate from this class, I am trying to return an instance of this class, however I want to filter the class based on a criterion, so I'm using a lambda expression:
var list = new FooList(); // imagine this fills it with different items
var filtered = list.FindAll(c => c.Something == "filter criteria");
now according to the FindAll method, this SHOULD return a List[Foo]. However, I want to return this object as a FooList, not a List[Foo]. Do I have to create a new instance of FooList and copy the items from the List[Foo]?
If so, why? why can't I convert a List to a FooList directly, since they are the same object?
If this CAN be done, how do I do it?
many thanks!