I've got a coding standard question for generic lists and .NET 2.0.
I have created some custom strongly typed lists like, MyClassList:List<MyClass>.
We did this because we wanted to reuse some helper methods that are at the list level, for instance, maybe we need to get some type of Average of MyClass's in the list so I have a method Average in the MyClassList class.
One of the problems with this is if I use something like Find or FindAll on my custom list. So, MyClassList.Find() returns a List<MyClass> and not MyClassList. This causes some issues when we're working with the lists in our code.
Another way we though about was to try and get rid of the custom lists altogether because I keep reading that you generally never need an actual list, you can usually just use custom iterators and other nice features.
Now I wonder what about my Average function, I could make it a static method in the MyClass class and just pass in a list, something like
static int Average(IEnumerable<MyClass> mylist)
{...}
But it doesn't seem right because I have a bunch of static functions in my class that really have to do with lists. Could someone maybe point me to some examples? I can get everything to work, but I just can't seem to find an elegant solution that isn't making temporary lists all over.