Linq 基础操做

Filter 操做

Where
OfType对象

The OfType operator filters the collection based on the ability to cast an element in a collection to a specified type.排序

排序操做

OrderBy
OrderByDescending
ThenBy
ThenByDescending
Reverseci

分组操做

GroupBy
ToLookupelement

关于分组操做须要注意,使用GroupBy, 返回的对象是IEnumerable<IGrouping> 类型的。
ToLookup 和GroupBy的行为是同样的,惟一的区别在于ToLookup是当即执行,而GroupBy是延迟执行的it

相关文章
相关标签/搜索