ImmutableArray<T> 結構

定義

代表不可變的陣列,意即在建立該陣列之後,就無法加以變更。

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)

generic <typename T>
public value class ImmutableArray : IEquatable<System::Collections::Immutable::ImmutableArray<T>>, System::Collections::Generic::ICollection<T>, System::Collections::Generic::IEnumerable<T>, System::Collections::Generic::IList<T>, System::Collections::Generic::IReadOnlyCollection<T>, System::Collections::Generic::IReadOnlyList<T>, System::Collections::IList, System::Collections::Immutable::IImmutableList<T>, System::Collections::IStructuralComparable, System::Collections::IStructuralEquatable
public struct ImmutableArray<T> : IEquatable<System.Collections.Immutable.ImmutableArray<T>>, System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.IList, System.Collections.Immutable.IImmutableList<T>, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable
public readonly struct ImmutableArray<T> : IEquatable<System.Collections.Immutable.ImmutableArray<T>>, System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.IList, System.Collections.Immutable.IImmutableList<T>, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable
type ImmutableArray<'T> = struct
    interface IReadOnlyList<'T>
    interface IReadOnlyCollection<'T>
    interface seq<'T>
    interface IEnumerable
    interface IList<'T>
    interface ICollection<'T>
    interface IImmutableList<'T>
    interface IList
    interface ICollection
type ImmutableArray<'T> = struct
    interface ICollection<'T>
    interface seq<'T>
    interface IEnumerable
    interface IList<'T>
    interface IReadOnlyCollection<'T>
    interface IReadOnlyList<'T>
    interface ICollection
    interface IList
    interface IImmutableList<'T>
Public Structure ImmutableArray(Of T)
Implements ICollection(Of T), IEnumerable(Of T), IEquatable(Of ImmutableArray(Of T)), IImmutableList(Of T), IList, IList(Of T), IReadOnlyCollection(Of T), IReadOnlyList(Of T), IStructuralComparable, IStructuralEquatable

類型參數

T

陣列所儲存的項目類型。

繼承
ImmutableArray<T>
實作

範例

此範例示範如何建立不可變的陣列,並逐一查看其中的專案:

// Create an immutable array of numbers
ImmutableArray<int> numbers = ImmutableArray.Create(1, 2, 3, 4, -1, -2);

// Iterate over all items in the array and print them
foreach (int n in numbers)
{
    Console.Write(n);
    Console.Write(' ');
}
// Output: 1 2 3 4 -1 -2

此範例示範如何新增和移除原始陣列中的專案,以建立新的不可變數組:

ImmutableArray<int> numbers2 = numbers.RemoveAt(0).Add(-3);
// numbers2 will contain: 2 3 4 -1 -2 -3

此範例示範如何使用 建立不可變的陣列 ImmutableArray<T>.Builder

// Create immutable array builder
ImmutableArray<int>.Builder builder = ImmutableArray.CreateBuilder<int>();

// Iterate over all items in the original array and add positive elements to the builder
for (int i = 0; i < numbers.Length; i++)
{
    if (numbers[i] > 0) builder.Add(numbers[i]);
}

// Create an immutable array from the contents of the builder
ImmutableArray<int> numbers3 = builder.ToImmutable();
// numbers3 will contain: 1 2 3 4

備註

有不同的案例最適合, ImmutableArray<T> 而其他案例則最適合 ImmutableList<T>

使用不可變數組的原因:

  • 更新資料很罕見,或元素數目相當小, (小於 16 個專案)

  • 您必須能夠在效能關鍵區段中逐一查看資料

  • 您有許多不可變集合的實例,而且無法讓資料保留在樹狀結構中

使用不可變清單的原因:

  • 更新資料很常見,或專案數目不預期很小

  • 更新集合比重複內容更具效能關鍵性

下表摘要說明 的效能特性 ImmutableArray<T>

運算 ImmutableArray<T> 複雜性 ImmutableList<T> 複雜性 註解
Item O(1) O (記錄 n) 直接編制索引到基礎陣列
Add() O (n) O (記錄 n) 需要建立新的陣列

欄位

Empty

取得空的不可變陣列。

屬性

IsDefault

取得值,指出這個陣列已宣告但未初始化。

IsDefaultOrEmpty

取得值,指出這個 ImmutableArray<T> 是否為空的,或者尚未初始化。

IsEmpty

取得值,指出這個 ImmutableArray<T> 是否為空的。

Item[Int32]

取得不可變陣列中指定索引處的項目。

Length

取得陣列中的項目數。

方法

Add(T)

傳回已在結尾處加入指定項目的原始陣列複本。

AddRange(IEnumerable<T>)

傳回已在陣列結尾處加入指定項目的原始陣列複本。

AddRange(ImmutableArray<T>)

傳回已在陣列結尾處加入指定項目的原始陣列複本。

AddRange(ImmutableArray<T>, Int32)

將指定的項目加入至陣列尾端。

AddRange(ReadOnlySpan<T>)

將指定的值新增至此清單。

AddRange(T[])

將指定的值新增至此清單。

AddRange(T[], Int32)

將指定的項目加入至陣列尾端。

AddRange<TDerived>(ImmutableArray<TDerived>)

將指定的項目加入至陣列尾端。

AddRange<TDerived>(TDerived[])

將指定的項目加入至陣列尾端。

As<TOther>()

傳回新的不可變陣列,其中包含這個陣列中轉換為不同類型的項目。

AsMemory()

在此不可變陣列上建立新的唯讀記憶體區域。

AsSpan()

在此不可變陣列上建立新的唯讀範圍。

AsSpan(Int32, Int32)

ReadOnlySpan<T> 目前 ImmutableArray<T> 的部分上建立 ,從指定長度的指定位置開始。

AsSpan(Range)

根據指定的 range ,建立目前 ImmutableArray<T> 部分的跨越範圍。

CastArray<TOther>()

將基礎陣列轉換成 TOther 型別的陣列,以將 ImmutableArray<T> 結構的新執行個體初始化。

CastUp<TDerived>(ImmutableArray<TDerived>)

根據現有執行個體的內容初始化新 ImmutableArray<T> 結構執行個體,允許 Covariant 靜態轉換,以便有效率地重複使用現有陣列。

Clear()

傳回已移除所有項目的陣列。

Contains(T)

判斷指定的項目是否存在於陣列中。

Contains(T, IEqualityComparer<T>)

判斷指定的項目是否存在於陣列中。

CopyTo(Int32, T[], Int32, Int32)

從指定的開始索引開始,將這個陣列中的指定項目複製到指定的陣列。

CopyTo(Span<T>)

將目前 ImmutableArray<T>Span<T> 的專案複製到 。

CopyTo(T[])

將這個陣列的內容複製到指定的陣列。

CopyTo(T[], Int32)

從指定之目的索引開始,將這個陣列的內容複製到指定的陣列。

Equals(ImmutableArray<T>)

表示指定的物件是否等於這個陣列。

Equals(Object)

判斷這個陣列是否等於指定的物件。

GetEnumerator()

傳回可逐一查看陣列內容的列舉程式。

GetHashCode()

傳回這個執行個體的雜湊碼。

IndexOf(T)

在陣列中搜尋指定的項目。

IndexOf(T, Int32)

在陣列中搜尋指定的項目。

IndexOf(T, Int32, IEqualityComparer<T>)

在陣列中搜尋指定的項目。

IndexOf(T, Int32, Int32)

在陣列中搜尋指定的項目。

IndexOf(T, Int32, Int32, IEqualityComparer<T>)

在陣列中搜尋指定的項目。

Insert(Int32, T)

傳回已在指定位置插入指定值的新陣列。

InsertRange(Int32, IEnumerable<T>)

在指定的索引處插入指定的值。

InsertRange(Int32, ImmutableArray<T>)

在指定的索引處插入指定的值。

InsertRange(Int32, ReadOnlySpan<T>)

在指定的索引處插入指定的值。

InsertRange(Int32, T[])

在指定的索引處插入指定的值。

ItemRef(Int32)

取得唯讀清單中在指定 index 處元素的唯讀參考。

LastIndexOf(T)

從陣列結尾開始,在陣列中搜尋指定的項目。

LastIndexOf(T, Int32)

從陣列結尾開始,在陣列中搜尋指定的項目。

LastIndexOf(T, Int32, Int32)

從陣列結尾開始,在陣列中搜尋指定的項目。

LastIndexOf(T, Int32, Int32, IEqualityComparer<T>)

從陣列結尾開始,在陣列中搜尋指定的項目。

OfType<TResult>()

篩選這個陣列的項目,以取得可指派為指定類型的項目。

Remove(T)

傳回已從陣列中移除第一個出現之指定項目的陣列。 如果找不到相符項目,則會傳回目前的陣列。

Remove(T, IEqualityComparer<T>)

傳回已從陣列中移除第一個出現之指定項目的陣列。

如果找不到相符項目,則會傳回目前的陣列。

RemoveAll(Predicate<T>)

從陣列中移除符合指定條件的所有項目。

RemoveAt(Int32)

傳回已移除指定位置處之項目的陣列。

RemoveRange(IEnumerable<T>)

從這個陣列中移除指定的項目。

RemoveRange(IEnumerable<T>, IEqualityComparer<T>)

從這個陣列中移除指定的項目。

RemoveRange(ImmutableArray<T>)

從這個清單中移除指定的值。

RemoveRange(ImmutableArray<T>, IEqualityComparer<T>)

從這個清單中移除指定的項目。

RemoveRange(Int32, Int32)

傳回已移除指定位置處之項目的陣列。

RemoveRange(ReadOnlySpan<T>, IEqualityComparer<T>)

從這個清單中移除指定的值。

RemoveRange(T[], IEqualityComparer<T>)

從這個清單中移除指定的值。

Replace(T, T)

尋找陣列中第一個等於指定值的項目,並使用指定的新值來取代該值。

Replace(T, T, IEqualityComparer<T>)

尋找陣列中第一個等於指定值的項目,並使用指定的新值來取代該值。

SetItem(Int32, T)

以指定的項目取代位於指定索引上的項目。

Slice(Int32, Int32)

從目前 ImmutableArray<T> 開始的配量,從指定的索引開始,指定長度。

Sort()

使用預設的比較子,來排序不可變陣列中的項目。

Sort(Comparison<T>)

使用指定的 Comparison<T> 來排序在整個 ImmutableArray<T> 中的項目。

Sort(IComparer<T>)

使用指定的比較子,來排序不可變陣列中的項目。

Sort(Int32, Int32, IComparer<T>)

使用指定的比較子,來排序不可變陣列中指定的項目。

ToBuilder()

建立可變動的陣列,其具有與此陣列相同的內容,而且能夠使用標準變動介面,有效率地跨多個作業進行變動。

運算子

Equality(ImmutableArray<T>, ImmutableArray<T>)

傳回值,這個值指出兩個陣列是否相等。

Equality(Nullable<ImmutableArray<T>>, Nullable<ImmutableArray<T>>)

傳回值,這個值指出兩個陣列是否相等。

Inequality(ImmutableArray<T>, ImmutableArray<T>)

傳回值,這個值指出兩個陣列是否不相等。

Inequality(Nullable<ImmutableArray<T>>, Nullable<ImmutableArray<T>>)

檢查兩個陣列間的不相等。

明確介面實作

ICollection.CopyTo(Array, Int32)

從指定的索引處開始,將這個陣列複製到其他陣列。

ICollection.Count

取得陣列的大小。

ICollection.IsSynchronized

請參閱 ICollection 介面。 因為不可變的集合為安全執行緒,所以一律傳回 true

ICollection.SyncRoot

取得同步處理根項目。

ICollection<T>.Add(T)

在所有情況下都會擲回 NotSupportedException

ICollection<T>.Clear()

在所有情況下都會擲回 NotSupportedException

ICollection<T>.Count

取得集合中的項目數目。

ICollection<T>.IsReadOnly

取得值,這個值指出這個執行個體是否為唯讀。

ICollection<T>.Remove(T)

在所有情況下都會擲回 NotSupportedException

IEnumerable.GetEnumerator()

傳回可逐一查看不可變陣列的列舉程式。

IEnumerable<T>.GetEnumerator()

傳回可逐一查看陣列的列舉程式。

IImmutableList<T>.Add(T)

傳回已在結尾處加入指定項目的原始陣列複本。

IImmutableList<T>.AddRange(IEnumerable<T>)

傳回已在陣列結尾處加入指定項目的原始陣列複本。

IImmutableList<T>.Clear()

傳回已移除所有項目的陣列。

IImmutableList<T>.Insert(Int32, T)

傳回已在指定位置插入指定值的新陣列。

IImmutableList<T>.InsertRange(Int32, IEnumerable<T>)

在指定的索引處插入指定的值。

IImmutableList<T>.Remove(T, IEqualityComparer<T>)

傳回已從陣列中移除第一個出現之指定項目的陣列,如果找不到相符項目,則會傳回目前的陣列。

IImmutableList<T>.RemoveAll(Predicate<T>)

從陣列中移除符合指定條件的所有項目。

IImmutableList<T>.RemoveAt(Int32)

傳回已移除指定位置處之項目的陣列。

IImmutableList<T>.RemoveRange(IEnumerable<T>, IEqualityComparer<T>)

從這個陣列中移除指定的項目。

IImmutableList<T>.RemoveRange(Int32, Int32)

傳回已移除指定位置處之項目的陣列。

IImmutableList<T>.Replace(T, T, IEqualityComparer<T>)

尋找陣列中第一個等於指定值的項目,並使用指定的新值來取代該值。

IImmutableList<T>.SetItem(Int32, T)

以指定的項目取代位於指定索引上的項目。

IList.Add(Object)

在所有情況下都會擲回 NotSupportedException

IList.Clear()

在所有情況下都會擲回 NotSupportedException

IList.Contains(Object)

在所有情況下都會擲回 NotSupportedException

IList.IndexOf(Object)

取得指定索引處的值。

IList.Insert(Int32, Object)

在所有情況下都會擲回 NotSupportedException

IList.IsFixedSize

取得值,指出此執行個體是否有固定的大小。

IList.IsReadOnly

取得值,這個值指出這個執行個體是否為唯讀。

IList.Item[Int32]

取得或設定在指定索引處的 Object

IList.Remove(Object)

在所有情況下都會擲回 NotSupportedException

IList.RemoveAt(Int32)

在所有情況下都會擲回 NotSupportedException

IList<T>.Insert(Int32, T)

在所有情況下都會擲回 NotSupportedException

IList<T>.Item[Int32]

取得或設定唯讀清單中指定索引處的項目。

IList<T>.RemoveAt(Int32)

在所有情況下都會擲回 NotSupportedException

IReadOnlyCollection<T>.Count

取得集合中的項目數目。

IReadOnlyList<T>.Item[Int32]

取得位在指定索引處的元素。

IStructuralComparable.CompareTo(Object, IComparer)

判斷目前的集合項目在排序次序中位於另一個項目之前、相同位置或之後。

IStructuralEquatable.Equals(Object, IEqualityComparer)

判斷這個陣列在結構上是否等於指定的陣列。

IStructuralEquatable.GetHashCode(IEqualityComparer)

傳回目前執行個體的雜湊碼。

擴充方法

ToFrozenDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

FrozenDictionary<TKey,TValue>根據指定的索引鍵選取器函式,從 IEnumerable<T> 建立 。

ToFrozenDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器和項目選取器函式,從 FrozenDictionary<TKey,TValue> 建立 IEnumerable<T>

ToFrozenSet<T>(IEnumerable<T>, IEqualityComparer<T>)

FrozenSet<T>使用指定的值建立 。

AsReadOnly<T>(IList<T>)

傳回指定清單的唯讀 ReadOnlyCollection<T> 包裝函式。

BinarySearch<T>(ImmutableArray<T>, T)

使用預設的比較子搜尋指定項目已排序的不可變陣列,並在找到時,傳回該項目以零為起始的索引。

BinarySearch<T>(ImmutableArray<T>, T, IComparer<T>)

搜尋指定項目已排序的不可變陣列,並在找到時,傳回該項目以零為起始的索引。

BinarySearch<T>(ImmutableArray<T>, Int32, Int32, T)

搜尋指定項目已排序的不可變陣列,並在找到時,傳回該項目以零為起始的索引。

BinarySearch<T>(ImmutableArray<T>, Int32, Int32, T, IComparer<T>)

搜尋指定項目已排序的不可變陣列,並傳回該項目以零為起始的索引。

ToImmutableArray<TSource>(IEnumerable<TSource>)

從指定的集合建立不可變的陣列。

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

從現有的項目集合建構不可變的字典,將轉換函式套用至來源索引鍵。

ToImmutableDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據序列的某些轉換來建構不可變的字典。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

列舉及轉換序列,並產生其內容的不可變字典。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>)

列舉及轉換序列,並使用指定的索引鍵比較子產生其內容的不可變字典。

ToImmutableDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)

列舉及轉換序列,並使用指定的索引鍵與值比較子產生其內容的不可變字典。

ToImmutableHashSet<TSource>(IEnumerable<TSource>)

列舉序列,並產生其內容之不可變雜湊集。

ToImmutableHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

列舉序列、產生其內容之不可變雜湊集,且針對集合類型使用指定的相等比較子。

IndexOf<T>(IImmutableList<T>, T)

搜尋指定的物件,並傳回清單中第一個出現項目以零為起始的索引。

IndexOf<T>(IImmutableList<T>, T, IEqualityComparer<T>)

搜尋指定的物件,並傳回清單中第一個出現項目以零為起始的索引。

IndexOf<T>(IImmutableList<T>, T, Int32)

搜尋指定的物件,並傳回不可變的清單中,從指定索引開始到最後一個項目的項目範圍內,第一個出現項目以零為起始的索引。

IndexOf<T>(IImmutableList<T>, T, Int32, Int32)

搜尋指定的物件,並傳回不可變的清單中,從指定索引開始到最後一個項目的項目範圍內,第一個出現項目以零為起始的索引。

LastIndexOf<T>(IImmutableList<T>, T)

搜尋指定的物件,並傳回整個不可變的清單中最後一個出現項目以零為起始的索引。

LastIndexOf<T>(IImmutableList<T>, T, IEqualityComparer<T>)

搜尋指定的物件,並傳回整個不可變的清單中最後一個出現項目以零為起始的索引。

LastIndexOf<T>(IImmutableList<T>, T, Int32)

搜尋指定的物件,並傳回不可變的清單中,從第一個項目開始到指定索引的項目範圍內,最後一個出現項目以零為起始的索引。

LastIndexOf<T>(IImmutableList<T>, T, Int32, Int32)

搜尋指定的物件,並傳回不可變的清單中,從第一個項目開始到指定索引的項目範圍內,最後一個出現項目以零為起始的索引。

Remove<T>(IImmutableList<T>, T)

從這個清單中移除指定的值。

RemoveRange<T>(IImmutableList<T>, IEnumerable<T>)

從這個清單中移除指定的值。

Replace<T>(IImmutableList<T>, T, T)

使用指定的項目,來取代清單中第一個相等的項目。

ToImmutableList<TSource>(IEnumerable<TSource>)

列舉序列,並產生其內容的不可變清單。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>)

列舉及轉換序列,並產生不可變的排序字典作為內容。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>)

列舉及轉換序列,並使用指定的索引鍵比較子產生不可變的排序字典作為內容。

ToImmutableSortedDictionary<TSource,TKey,TValue>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TValue>, IComparer<TKey>, IEqualityComparer<TValue>)

列舉及轉換序列,並使用指定的索引鍵與值比較子產生不可變的排序字典作為內容。

ToImmutableSortedSet<TSource>(IEnumerable<TSource>)

列舉序列,並產生其內容的不可變排序資料集。

ToImmutableSortedSet<TSource>(IEnumerable<TSource>, IComparer<TSource>)

列舉序列、產生其內容的不可變排序資料集,並使用指定的比較子。

CopyToDataTable<T>(IEnumerable<T>)

根據輸入 DataTable 物件 (其中泛型參數 TDataRow) 傳回包含 IEnumerable<T> 物件複本的 DataRow

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRow

CopyToDataTable<T>(IEnumerable<T>, DataTable, LoadOption, FillErrorEventHandler)

根據輸入 DataRow 物件 (其中泛型參數 TDataTable),將 IEnumerable<T> 物件複製到指定的 DataRow

Aggregate<TSource>(IEnumerable<TSource>, Func<TSource,TSource,TSource>)

將累加函式套用到序列上。

Aggregate<TSource,TAccumulate>(IEnumerable<TSource>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>)

將累加函式套用到序列上。 使用指定的初始值做為初始累加值。

Aggregate<TSource,TAccumulate,TResult>(IEnumerable<TSource>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, Func<TAccumulate,TResult>)

將累加函式套用到序列上。 使用指定的值做為初始累加值,並使用指定的函式來選取結果值。

AggregateBy<TSource,TKey,TAccumulate>(IEnumerable<TSource>, Func<TSource, TKey>, TAccumulate, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

代表不可變的陣列,意即在建立該陣列之後,就無法加以變更。

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)

AggregateBy<TSource,TKey,TAccumulate>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TKey,TAccumulate>, Func<TAccumulate,TSource,TAccumulate>, IEqualityComparer<TKey>)

代表不可變的陣列,意即在建立該陣列之後,就無法加以變更。

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)

All<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

判斷序列的所有項目是否全都符合條件。

Any<TSource>(IEnumerable<TSource>)

判斷序列是否包含任何項目。

Any<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

判斷序列的任何項目是否符合條件。

Append<TSource>(IEnumerable<TSource>, TSource)

將值附加在序列結尾。

AsEnumerable<TSource>(IEnumerable<TSource>)

傳回 IEnumerable<T> 類型的輸入。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Decimal 值序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Double 值序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Int32 值序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Int64 值序列的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Decimal 值的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Double 值的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Int32 值的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Int64 值的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Single 值的平均值。

Average<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Single 值序列的平均值。

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

Chunk<TSource>(IEnumerable<TSource>, Int32)

將序列的專案分割成大小上限 size 的區塊。

Concat<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

串連兩個序列。

Contains<TSource>(IEnumerable<TSource>, TSource)

使用預設的相等比較子 (Comparer) 來判斷序列是否包含指定的項目。

Contains<TSource>(IEnumerable<TSource>, TSource, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T> 來判斷序列是否包含指定的項目。

Count<TSource>(IEnumerable<TSource>)

傳回序列中的項目數。

Count<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回數字,代表指定之序列中符合條件的項目數目。

CountBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

代表不可變的陣列,意即在建立該陣列之後,就無法加以變更。

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)

DefaultIfEmpty<TSource>(IEnumerable<TSource>)

傳回指定之序列的項目;如果序列是空的,則傳回單一集合中型別參數的預設值。

DefaultIfEmpty<TSource>(IEnumerable<TSource>, TSource)

傳回指定之序列的項目;如果序列是空的,則傳回單一集合中型別參數的預設值。

Distinct<TSource>(IEnumerable<TSource>)

使用預設的相等比較子來比較值,以便從序列傳回獨特的項目。

Distinct<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T> 來比較值,以便從序列傳回獨特的項目。

DistinctBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,從序列傳回不同的專案。

DistinctBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,並使用指定的比較子來比較索引鍵,從序列傳回不同的元素。

ElementAt<TSource>(IEnumerable<TSource>, Index)

傳回位於序列中指定索引處的項目。

ElementAt<TSource>(IEnumerable<TSource>, Int32)

傳回位於序列中指定索引處的項目。

ElementAtOrDefault<TSource>(IEnumerable<TSource>, Index)

傳回位於序列中指定索引處的元素;如果索引超出範圍,則傳回預設值。

ElementAtOrDefault<TSource>(IEnumerable<TSource>, Int32)

傳回位於序列中指定索引處的元素;如果索引超出範圍,則傳回預設值。

Except<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

使用預設相等比較子來比較值,以便產生兩個序列的差異。

Except<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T> 來比較值,以便產生兩個序列的差異。

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合差異。

ExceptBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合差異。

First<TSource>(IEnumerable<TSource>)

傳回序列的第一個項目。

First<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列中符合指定條件的第一個元素。

FirstOrDefault<TSource>(IEnumerable<TSource>)

傳回序列的第一個元素;如果序列中沒有包含任何元素,則傳回預設值。

FirstOrDefault<TSource>(IEnumerable<TSource>, TSource)

傳回序列的第一個專案,如果序列不包含任何元素,則傳回指定的預設值。

FirstOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列中符合條件的第一個元素;如果找不到這類元素,則傳回預設值。

FirstOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>, TSource)

傳回符合條件之序列的第一個專案,如果找不到這類專案,則傳回指定的預設值。

GroupBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

依據指定的索引鍵選擇器函式來群組序列的項目。

GroupBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

依據指定的索引鍵選取器函式來群組序列的項目,並使用指定的比較子來比較索引鍵。

GroupBy<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

依據指定的索引鍵選取器函式來群組序列的項目,並使用指定的函式來投影每個群組的項目。

GroupBy<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

依據索引鍵選取器函式來群組序列中的項目。 索引鍵是使用比較子來進行比較,而每個群組的項目都是利用指定的函式進行投影。

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,TResult>)

依據指定的索引鍵選取器函式來群組序列的項目,並從每個群組及其索引鍵建立結果值。

GroupBy<TSource,TKey,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TKey,IEnumerable<TSource>,TResult>, IEqualityComparer<TKey>)

依據指定的索引鍵選取器函式來群組序列的項目,並從每個群組及其索引鍵建立結果值。 索引鍵是使用指定的比較子來進行比較。

GroupBy<TSource,TKey,TElement,TResult>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>,TResult>)

依據指定的索引鍵選取器函式來群組序列的項目,並從每個群組及其索引鍵建立結果值。 每個群組的項目都是利用指定的函式進行投影。

GroupBy<TSource,TKey,TElement,TResult>(IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource,TElement>, Func<TKey,IEnumerable<TElement>, TResult>, IEqualityComparer<TKey>)

依據指定的索引鍵選取器函式來群組序列的項目,並從每個群組及其索引鍵建立結果值。 索引鍵值是使用指定的比較子來進行比較,而每個群組的項目則都是利用指定的函式進行投影。

GroupJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,IEnumerable<TInner>, TResult>)

根據索引鍵相等與否,將兩個序列的項目相互關聯,並群組產生的結果。 預設的相等比較子是用於比較索引鍵。

GroupJoin<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,IEnumerable<TInner>, TResult>, IEqualityComparer<TKey>)

根據索引鍵相等與否,將兩個序列的項目相互關聯,並群組產生的結果。 指定的 IEqualityComparer<T> 是用於比較索引鍵。

Index<TSource>(IEnumerable<TSource>)

代表不可變的陣列,意即在建立該陣列之後,就無法加以變更。

NuGet 套件System.Collections.Immutable (關於固定集合及其安裝方法)

Intersect<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

使用預設相等比較子來比較值,以便產生兩個序列的交集。

Intersect<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T> 來比較值,以便產生兩個序列的交集。

IntersectBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合交集。

IntersectBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TKey>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合交集。

Join<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>)

根據相符索引鍵,將兩個序列的項目相互關聯。 預設的相等比較子是用於比較索引鍵。

Join<TOuter,TInner,TKey,TResult>(IEnumerable<TOuter>, IEnumerable<TInner>, Func<TOuter,TKey>, Func<TInner,TKey>, Func<TOuter,TInner,TResult>, IEqualityComparer<TKey>)

根據相符索引鍵,將兩個序列的項目相互關聯。 指定的 IEqualityComparer<T> 是用於比較索引鍵。

Last<TSource>(IEnumerable<TSource>)

傳回序列的最後一個項目。

Last<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列中符合指定之條件的最後一個元素。

LastOrDefault<TSource>(IEnumerable<TSource>)

傳回序列的最後一個元素;如果序列中沒有包含任何元素,則傳回預設值。

LastOrDefault<TSource>(IEnumerable<TSource>, TSource)

傳回序列的最後一個專案,如果序列不包含任何元素,則傳回指定的預設值。

LastOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列中符合條件的最後一個元素;如果找不到這類元素,則傳回預設值。

LastOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>, TSource)

傳回符合條件之序列的最後一個專案,如果找不到這類專案,則傳回指定的預設值。

LongCount<TSource>(IEnumerable<TSource>)

傳回代表序列中項目總數的 Int64

LongCount<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回 Int64,其代表序列中符合條件的項目數目。

Max<TSource>(IEnumerable<TSource>)

傳回泛型序列中的最大值。

Max<TSource>(IEnumerable<TSource>, IComparer<TSource>)

傳回泛型序列中的最大值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

在序列的每個項目上叫用轉換函式,並傳回最大的 Decimal 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

在序列的每個項目上叫用轉換函式,並傳回最大的 Double 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

在序列的每個項目上叫用轉換函式,並傳回最大的 Int32 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

在序列的每個項目上叫用轉換函式,並傳回最大的 Int64 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

在序列的每個項目上叫用轉換函式,並傳回最大的可為 Null 之 Decimal 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

在序列的每個項目上叫用轉換函式,並傳回最大的可為 Null 之 Double 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

在序列的每個項目上叫用轉換函式,並傳回最大的可為 Null 之 Int32 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

在序列的每個項目上叫用轉換函式,並傳回最大的可為 Null 之 Int64 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

在序列的每個項目上叫用轉換函式,並傳回最大的可為 Null 之 Single 值。

Max<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

在序列的每個項目上叫用轉換函式,並傳回最大的 Single 值。

Max<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

在泛型序列的每個項目上叫用轉換函式,並傳回最大的結果值。

MaxBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,傳回泛型序列中的最大值。

MaxBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

根據指定的索引鍵選取器函式和索引鍵比較子,傳回泛型序列中的最大值。

Min<TSource>(IEnumerable<TSource>)

傳回泛型序列中的最小值。

Min<TSource>(IEnumerable<TSource>, IComparer<TSource>)

傳回泛型序列中的最小值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

在序列的每個項目上叫用轉換函式,並傳回最小的 Decimal 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

在序列的每個項目上叫用轉換函式,並傳回最小的 Double 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

在序列的每個項目上叫用轉換函式,並傳回最小的 Int32 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

在序列的每個項目上叫用轉換函式,並傳回最小的 Int64 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

在序列的每個項目上叫用轉換函式,並傳回最小的可為 Null 之 Decimal 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

在序列的每個項目上叫用轉換函式,並傳回最小的可為 Null 之 Double 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

在序列的每個項目上叫用轉換函式,並傳回最小的可為 Null 之 Int32 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

在序列的每個項目上叫用轉換函式,並傳回最小的可為 Null 之 Int64 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

在序列的每個項目上叫用轉換函式,並傳回最小的可為 Null 之 Single 值。

Min<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

在序列的每個項目上叫用轉換函式,並傳回最小的 Single 值。

Min<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

在泛型序列的每個項目上叫用轉換函式,並傳回最小的結果值。

MinBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,傳回泛型序列中的最小值。

MinBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

根據指定的索引鍵選取器函式和索引鍵比較子,傳回泛型序列中的最小值。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

Order<T>(IEnumerable<T>)

依遞增順序排序序列中的項目。

Order<T>(IEnumerable<T>, IComparer<T>)

依遞增順序排序序列中的項目。

OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

依據索引鍵,按遞增順序排序序列中的項目。

OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

使用指定的比較子,依遞增順序排序序列中的項目。

OrderByDescending<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

依據索引鍵,按遞減順序排序序列中的項目。

OrderByDescending<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)

使用指定的比較子,依遞減順序排序序列中的項目。

OrderDescending<T>(IEnumerable<T>)

依遞減順序排序序列中的項目。

OrderDescending<T>(IEnumerable<T>, IComparer<T>)

依遞減順序排序序列中的項目。

Prepend<TSource>(IEnumerable<TSource>, TSource)

將值新增至序列的開頭。

Reverse<TSource>(IEnumerable<TSource>)

反轉序列中項目的排序方向。

Select<TSource,TResult>(IEnumerable<TSource>, Func<TSource,TResult>)

將序列的每個元素規劃成一個新的表單。

Select<TSource,TResult>(IEnumerable<TSource>, Func<TSource,Int32,TResult>)

透過加入項目的索引,將序列的每個項目投影成新的表單。

SelectMany<TSource,TResult>(IEnumerable<TSource>, Func<TSource,IEnumerable<TResult>>)

將序列的每個項目都投影成 IEnumerable<T>,並將產生的序列簡化成單一序列。

SelectMany<TSource,TResult>(IEnumerable<TSource>, Func<TSource,Int32,IEnumerable<TResult>>)

將序列的每個項目都投影成 IEnumerable<T>,並將產生的序列簡化成單一序列。 各來源項目的索引是在該項目的投影表單中使用。

SelectMany<TSource,TCollection,TResult>(IEnumerable<TSource>, Func<TSource,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

將序列的每個項目投影為 IEnumerable<T>、將產生的序列簡化成單一序列,並對其中的每個項目叫用結果選取器函式。

SelectMany<TSource,TCollection,TResult>(IEnumerable<TSource>, Func<TSource,Int32,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

將序列的每個項目投影為 IEnumerable<T>、將產生的序列簡化成單一序列,並對其中的每個項目叫用結果選取器函式。 各來源項目的索引是在該項目的中繼投影表單中使用。

SequenceEqual<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

使用項目之型別的預設相等比較子來比較項目,以判斷兩個序列是否相等。

SequenceEqual<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T> 來比較項目,以判斷兩個序列是否相等。

Single<TSource>(IEnumerable<TSource>)

傳回序列的唯一一個元素,如果序列中不是正好一個元素,則擲回例外狀況。

Single<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列中符合指定之條件的唯一一個元素,如果有一個以上這類元素,則擲回例外狀況。

SingleOrDefault<TSource>(IEnumerable<TSource>)

傳回序列的唯一一個項目,如果序列是空白,則為預設值,如果序列中有一個以上的項目,這個方法就會擲回例外狀況。

SingleOrDefault<TSource>(IEnumerable<TSource>, TSource)

傳回序列的唯一元素,如果序列是空的,則傳回指定的預設值;如果序列中有一個以上的元素,這個方法就會擲回例外狀況。

SingleOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

傳回序列中符合指定之條件的唯一一個元素,如果沒有這類元素,則為預設值,如果有一個以上的元素符合條件,這個方法就會擲回例外狀況。

SingleOrDefault<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>, TSource)

傳回符合指定條件之序列的唯一元素,如果沒有這類專案,則傳回指定的預設值;如果多個元素符合條件,這個方法就會擲回例外狀況。

Skip<TSource>(IEnumerable<TSource>, Int32)

略過序列中指定的項目數目,然後傳回其餘項目。

SkipLast<TSource>(IEnumerable<TSource>, Int32)

傳回新的可列舉集合,其包含已省略來源集合最後 count 元素的所有 source 元素。

SkipWhile<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

只要指定的條件為 true,便略過序列中的項目,然後傳回其餘項目。

SkipWhile<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

只要指定的條件為 true,便略過序列中的項目,然後傳回其餘項目。 項目的索引是用於述詞功能的邏輯中。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Decimal>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Decimal 值序列的總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Double>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Double 值序列的總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Int32>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Int32 值序列的總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Int64>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Int64 值序列的總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Decimal>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Decimal 值的總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Double>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Double 值的總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int32>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Int32 值的總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Int64>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Int64 值的總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Nullable<Single>>)

計算在輸入序列中各項目上叫用轉換函式後所取得可為 Null 之 Single 值的總和。

Sum<TSource>(IEnumerable<TSource>, Func<TSource,Single>)

計算在輸入序列中各項目上叫用轉換函式後所取得之 Single 值序列的總和。

Take<TSource>(IEnumerable<TSource>, Int32)

從序列開頭傳回指定的連續項目數目。

Take<TSource>(IEnumerable<TSource>, Range)

傳回序列中連續專案的指定範圍。

TakeLast<TSource>(IEnumerable<TSource>, Int32)

傳回新的可列舉集合,其包含 source 的最後 count 元素。

TakeWhile<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

只要指定的條件為 true,就會傳回序列中的項目。

TakeWhile<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

只要指定的條件為 true,就會傳回序列中的項目。 項目的索引是用於述詞功能的邏輯中。

ToArray<TSource>(IEnumerable<TSource>)

IEnumerable<T> 建立陣列。

ToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選擇器函式,從 Dictionary<TKey,TValue> 建立 IEnumerable<T>

ToDictionary<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式和索引鍵比較子,從 Dictionary<TKey,TValue> 建立 IEnumerable<T>

ToDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

根據指定的索引鍵選取器和項目選取器函式,從 Dictionary<TKey,TValue> 建立 IEnumerable<T>

ToDictionary<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式、比較子和項目選取器函式,從 Dictionary<TKey,TValue> 建立 IEnumerable<T>

ToHashSet<TSource>(IEnumerable<TSource>)

IEnumerable<T> 建立 HashSet<T>

ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

使用比較金鑰的 comparerIEnumerable<T> 建立 HashSet<T>

ToList<TSource>(IEnumerable<TSource>)

IEnumerable<T> 建立 List<T>

ToLookup<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選擇器函式,從 Lookup<TKey,TElement> 建立 IEnumerable<T>

ToLookup<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式和索引鍵比較子,從 Lookup<TKey,TElement> 建立 IEnumerable<T>

ToLookup<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

根據指定的索引鍵選取器和項目選取器函式,從 Lookup<TKey,TElement> 建立 IEnumerable<T>

ToLookup<TSource,TKey,TElement>(IEnumerable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式、比較子和項目選取器函式,從 Lookup<TKey,TElement> 建立 IEnumerable<T>

TryGetNonEnumeratedCount<TSource>(IEnumerable<TSource>, Int32)

嘗試判斷序列中的元素數目,而不強制列舉。

Union<TSource>(IEnumerable<TSource>, IEnumerable<TSource>)

使用預設相等比較值來比較值,以便產生兩個序列的集合等位。

Union<TSource>(IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>)

使用指定的 IEqualityComparer<T> 產生兩個序列的集合等位。

UnionBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TSource>, Func<TSource,TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合聯集。

UnionBy<TSource,TKey>(IEnumerable<TSource>, IEnumerable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

根據指定的索引鍵選取器函式,產生兩個序列的集合聯集。

Where<TSource>(IEnumerable<TSource>, Func<TSource,Boolean>)

根據述詞來篩選值序列。

Where<TSource>(IEnumerable<TSource>, Func<TSource,Int32,Boolean>)

根據述詞來篩選值序列。 述詞函式的邏輯中使用各項目的索引。

Zip<TFirst,TSecond>(IEnumerable<TFirst>, IEnumerable<TSecond>)

從兩個指定序列中的元素產生一系列元組。

Zip<TFirst,TSecond,TThird>(IEnumerable<TFirst>, IEnumerable<TSecond>, IEnumerable<TThird>)

產生具有來自三個指定序列之元素的元組序列。

Zip<TFirst,TSecond,TResult>(IEnumerable<TFirst>, IEnumerable<TSecond>, Func<TFirst,TSecond,TResult>)

將指定的函式套用至兩個序列的對應項目,產生結果的序列。

Aggregate<T>(ImmutableArray<T>, Func<T,T,T>)

以累加的方式套用函式到序列的元素。

Aggregate<TAccumulate,T>(ImmutableArray<T>, TAccumulate, Func<TAccumulate,T,TAccumulate>)

以累加的方式套用函式到序列的元素。

Aggregate<TAccumulate,TResult,T>(ImmutableArray<T>, TAccumulate, Func<TAccumulate,T,TAccumulate>, Func<TAccumulate,TResult>)

以累加的方式套用函式到序列的元素。

All<T>(ImmutableArray<T>, Func<T,Boolean>)

取得值,該值指示此陣列中的所有元素是否符合指定條件。

Any<T>(ImmutableArray<T>)

取得值,該值指示此陣列中是否包含任何元素。

Any<T>(ImmutableArray<T>, Func<T,Boolean>)

取得值,該值指示此陣列中是否包含任何符合指定條件的元素。

ElementAt<T>(ImmutableArray<T>, Int32)

傳回位於陣列中指定索引處的元素。

ElementAtOrDefault<T>(ImmutableArray<T>, Int32)

傳回位於序列中指定索引處的元素;如果索引超出範圍,則傳回預設值。

First<T>(ImmutableArray<T>)

傳回陣列中第一個元素。

First<T>(ImmutableArray<T>, Func<T,Boolean>)

傳回序列中符合指定條件的第一個元素。

FirstOrDefault<T>(ImmutableArray<T>)

傳回序列的第一個元素;如果序列中沒有包含任何元素,則傳回預設值。

FirstOrDefault<T>(ImmutableArray<T>, Func<T,Boolean>)

傳回序列中符合條件的第一個元素;如果找不到這類元素,則傳回預設值。

Last<T>(ImmutableArray<T>)

傳回陣列的最後一個元素。

Last<T>(ImmutableArray<T>, Func<T,Boolean>)

傳回序列中符合指定之條件的最後一個元素。

LastOrDefault<T>(ImmutableArray<T>)

傳回序列的最後一個元素;如果序列中沒有包含任何元素,則傳回預設值。

LastOrDefault<T>(ImmutableArray<T>, Func<T,Boolean>)

傳回序列中符合條件的最後一個元素;如果找不到這類元素,則傳回預設值。

Select<T,TResult>(ImmutableArray<T>, Func<T,TResult>)

將序列的每個元素規劃成一個新的表單。

SelectMany<TSource,TCollection,TResult>(ImmutableArray<TSource>, Func<TSource,IEnumerable<TCollection>>, Func<TSource,TCollection,TResult>)

將序列的每個項目投影為 IEnumerable<T>、將產生的序列簡化成單一序列,並對其中的每個項目叫用結果選取器函式。

SequenceEqual<TDerived,TBase>(ImmutableArray<TBase>, IEnumerable<TDerived>, IEqualityComparer<TBase>)

根據相等比較子,判斷兩個序列是否相等。

SequenceEqual<TDerived,TBase>(ImmutableArray<TBase>, ImmutableArray<TDerived>, IEqualityComparer<TBase>)

根據相等比較子,判斷兩個序列是否相等。

SequenceEqual<TDerived,TBase>(ImmutableArray<TBase>, ImmutableArray<TDerived>, Func<TBase,TBase,Boolean>)

根據相等比較子,判斷兩個序列是否相等。

Single<T>(ImmutableArray<T>)

傳回序列的唯一一個元素,如果序列中不是正好一個元素,則擲回例外狀況。

Single<T>(ImmutableArray<T>, Func<T,Boolean>)

傳回序列中符合指定之條件的唯一一個元素,如果有一個以上這類元素,則擲回例外狀況。

SingleOrDefault<T>(ImmutableArray<T>)

傳回陣列的唯一一個元素,如果序列是空白,則為預設值,如果序列中有一個以上的元素,這個方法就會擲回例外狀況。

SingleOrDefault<T>(ImmutableArray<T>, Func<T,Boolean>)

傳回序列中符合指定之條件的唯一一個元素,如果沒有這類元素,則為預設值,如果有一個以上的元素符合條件,這個方法就會擲回例外狀況。

ToArray<T>(ImmutableArray<T>)

將此陣列的內容複製到可變動的陣列。

ToDictionary<TKey,T>(ImmutableArray<T>, Func<T,TKey>)

根據此陣列的內容建立字典。

ToDictionary<TKey,T>(ImmutableArray<T>, Func<T,TKey>, IEqualityComparer<TKey>)

根據此陣列的內容建立字典。

ToDictionary<TKey,TElement,T>(ImmutableArray<T>, Func<T,TKey>, Func<T,TElement>)

根據此陣列的內容建立字典。

ToDictionary<TKey,TElement,T>(ImmutableArray<T>, Func<T,TKey>, Func<T,TElement>, IEqualityComparer<TKey>)

根據此陣列的內容建立字典。

Where<T>(ImmutableArray<T>, Func<T,Boolean>)

根據述詞來篩選值序列。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsParallel<TSource>(IEnumerable<TSource>)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

AsQueryable<TElement>(IEnumerable<TElement>)

將泛型 IEnumerable<T> 轉換成泛型 IQueryable<T>

Ancestors<T>(IEnumerable<T>)

傳回包含來源集合中每個節點祖系的項目集合。

Ancestors<T>(IEnumerable<T>, XName)

傳回包含來源集合中每個節點祖系的已篩選項目集合。 集合中只會包含具有相符之 XName 的項目。

DescendantNodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目之子代節點的集合。

Descendants<T>(IEnumerable<T>)

傳回包含來源集合中每個項目和文件之子代項目的項目集合。

Descendants<T>(IEnumerable<T>, XName)

傳回已篩選的項目集合,其中包含來源集合中每個項目和文件的子代項目。 集合中只會包含具有相符之 XName 的項目。

Elements<T>(IEnumerable<T>)

傳回來源集合中每個項目和文件的子項目集合。

Elements<T>(IEnumerable<T>, XName)

傳回來源集合中每個項目和文件的已篩選子項目集合。 集合中只會包含具有相符之 XName 的項目。

InDocumentOrder<T>(IEnumerable<T>)

傳回包含來源集合中所有節點的節點集合,依據文件順序來排序。

Nodes<T>(IEnumerable<T>)

傳回來源集合中每個文件和項目的子節點集合。

Remove<T>(IEnumerable<T>)

在來源集合中,從每一個節點的父節點移除這些節點。

適用於

執行緒安全性

此型別具備執行緒安全。