Linq Where Clauses - Better to stack or combine?
- by burnt_hand
When writing a method chain for LINQ, I can do the Where statements one of two ways:
var blackOldCats = cats.Where(cat => cat.Age > 7 && cat.Colour == "noir" )
Or
var blackOldCats = cats.Where(cat => cat.Age > 7).Where(cat.Colour == "noir" )
Are there any benefits of one over the other?
Don't worry too much about the datatypes in this example, but if there are issues with datatypes, then that would be good to know too.