Hi folks,
i have an IList<Animals> farmAnimals;
this list has three types,
- Cows
- Sheep
- Chickens
how can i remove all the Chickens from the list using a lambda query or linq-to-objects so i have a separate list of chickens and the original list now only has cows and sheep.
Do i have to make three lists (the original + 2 new ones, filtered) and then null the original list? or is there a trickier way?
result needs to be
IList<Aniamls> chickens;
IList<Animals> farmAnimals; // only contains the cows and sheep, now.
cheers!
CLARIFICATION QUESTION:
what is more performant? FindAll & RemoveAll versus the Where suggestion?