Maybe I just remember things completely back, but I would like to know more about what I am doing wrong ...
I declared the class to be nothing more than direct inheritance from a generic list (made to simplify naming), something like this:
public class FooList : List<Foo> {}
now in another method, completely separate from this class, I'm trying to return an instance of this class, however I want to filter the class based on the criteria, so I use the lambda expression:
var list = new FooList();
now according to the FindAll method, it SHOULD return the list [Foo]. However, I want to return this object as a FooList, not a List [Foo]. Should I create a new instance of FooList and copy the items from the [Foo] list?
If so, why? why can't I directly convert the list to a FooList, since they are the same object?
If it CAN be done, how can I do it?
many thanks!
source share