Why use .AsEnumerable() rather than casting to IEnumerable?

Technology CommunityCategory: LINQWhy use .AsEnumerable() rather than casting to IEnumerable?
VietMX Staff asked 3 years ago

Readability is the main issue here. Consider that

Table.AsEnumerable().Where(somePredicate)

is far more readable than

((IEnumerable<TableObject>)Table).Where(somePredicate).