Ok obviously I need to research some more about the difference between IEnumerable and IList because honestly I do not know what difference it makes to use either one of those. I decided to use IE because that's what was being returned from my repository (which basically uses EF to query the DB).
You guys confused the hell out of me now lol. Would the following statement cause any issues? (because IEnumerable holds infinite number of items)
IEnumerable<Category> result = _repository.GetCategories();
results.ForEach(a=> a.Left += 2, a=> a.Right +=2);
Again, all what I'm trying to do is replace the following with the above code:
IEnumerable<Category> result = _repository.GetCategories();
foreach(Category c in result) {
c.Left += 2;
c.Right += 2;
}
Why? Simply because I like to chain my methods. Period. :)