1.where Filtering Operators Description Where Returns values from the collection based on a predicate function OfType Returns values from the collection based on a specified type. However, it will depend on their ability to cast to a specified type.…
Grouping Operators Description GroupBy GroupBy操作返回根据一些键值进行分组,每组代表IGrouping<TKey,TElement>对象 ToLookup ToLookup is the same as GroupBy; the only difference is the execution of GroupBy is deferred whereas ToLookup execution is immediate. IList<Stude…
OfType操作根据集合中的元素是否是给定的类型进行筛选 IList mixedList = new ArrayList(); mixedList.Add(); mixedList.Add("One"); mixedList.Add("Two"); mixedList.Add(); mixedList.Add(, StudentName = "Bill" }); var stringResult = from s in mixedList.OfT…