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

相關文章
相關標籤/搜索