I have a collection of cars. I want to put it on separate lists by car property.. Lets say that brand.
So, if I have a collection of some Ford, some Chevy, some BMW, etc., I want a separate list for each of these buckets.
sort of:
IEnumberable<Car> myCarCollection = GetCollection();
List<IEnumerable<Car>> buckets = myCarCollection.BucketBy(r=>r.Brand)
is there something like this or do i need to do this "manually" through loops
source
share