語言

QueryableExtensions.ToDictionaryAsync 方法

定義

多載

名稱 Description
ToDictionaryAsync<TSource,TKey,TElement>(IQueryable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

透過非同步列舉,依照指定的鍵選擇器與元素選擇函式,從 建立 a Dictionary<TKey,TValue>IQueryable<T> 。

ToDictionaryAsync<TSource,TKey,TElement>(IQueryable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

透過非同步列舉,依照指定的鍵選擇函數、比較器及元素選擇函式,從 和 IQueryable<T> 建立 aDictionary<TKey,TValue>。

ToDictionaryAsync<TSource,TKey,TElement>(IQueryable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, CancellationToken)

透過非同步列舉,依照指定的鍵選擇器與元素選擇函式,從 建立 a Dictionary<TKey,TValue>IQueryable<T> 。

ToDictionaryAsync<TSource,TKey,TElement>(IQueryable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>, CancellationToken)

透過非同步列舉,依照指定的鍵選擇函數、比較器及元素選擇函式,從 和 IQueryable<T> 建立 aDictionary<TKey,TValue>。

ToDictionaryAsync<TSource,TKey>(IQueryable<TSource>, Func<TSource,TKey>)

透過非同步列舉,依照指定的鍵選擇函式從 中IQueryable<T>建立 aDictionary<TKey,TValue>。

ToDictionaryAsync<TSource,TKey>(IQueryable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

透過非同步列舉,根據指定的金鑰選擇函式與比較器,從 和 IQueryable<T> 建立 。Dictionary<TKey,TValue>

ToDictionaryAsync<TSource,TKey>(IQueryable<TSource>, Func<TSource,TKey>, CancellationToken)

透過非同步列舉,依照指定的鍵選擇函式從 中IQueryable<T>建立 aDictionary<TKey,TValue>。

ToDictionaryAsync<TSource,TKey>(IQueryable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>, CancellationToken)

透過非同步列舉,根據指定的金鑰選擇函式與比較器,從 和 IQueryable<T> 建立 。Dictionary<TKey,TValue>

ToDictionaryAsync<TSource,TKey,TElement>(IQueryable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>)

透過非同步列舉,依照指定的鍵選擇器與元素選擇函式,從 建立 a Dictionary<TKey,TValue>IQueryable<T> 。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<TKey,TElement>> ToDictionaryAsync<TSource,TKey,TElement>(this System.Linq.IQueryable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector);
static member ToDictionaryAsync : System.Linq.IQueryable<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<'Key, 'Element>>
<Extension()>
Public Function ToDictionaryAsync(Of TSource, TKey, TElement) (source As IQueryable(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TElement)) As Task(Of Dictionary(Of TKey, TElement))

類型參數

TSource

元素 source的類型。

TKey

由 返回 keySelector 的金鑰類型。

TElement

由 返回 elementSelector的值類型。

參數

source
IQueryable<TSource>

一個 IQueryable<T> 創造一個 Dictionary<TKey,TValue> 。

keySelector
Func<TSource,TKey>

一個用來從每個元素中提取鍵值的函式。

elementSelector
Func<TSource,TElement>

一個轉換函數,從每個元素產生結果元素值。

傳回

Task<Dictionary<TKey,TElement>>

一個代表非同步操作的任務。 任務結果包含 a Dictionary<TKey,TValue> ,該 包含從輸入序列中選擇的值 TElement 。

屬性

備註

不支援在同一上下文實例上進行多個主動操作。 在此上下文中呼叫其他方法前,請使用「wait」以確保所有非同步操作已完成。

適用於

ToDictionaryAsync<TSource,TKey,TElement>(IQueryable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>)

透過非同步列舉,依照指定的鍵選擇函數、比較器及元素選擇函式,從 和 IQueryable<T> 建立 aDictionary<TKey,TValue>。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<TKey,TElement>> ToDictionaryAsync<TSource,TKey,TElement>(this System.Linq.IQueryable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector, System.Collections.Generic.IEqualityComparer<TKey> comparer);
static member ToDictionaryAsync : System.Linq.IQueryable<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<'Key, 'Element>>
<Extension()>
Public Function ToDictionaryAsync(Of TSource, TKey, TElement) (source As IQueryable(Of TSource), keySelector As Func(Of TSource, TKey), elementSelector As Func(Of TSource, TElement), comparer As IEqualityComparer(Of TKey)) As Task(Of Dictionary(Of TKey, TElement))

類型參數

TSource

元素 source的類型。

TKey

由 返回 keySelector 的金鑰類型。

TElement

由 返回 elementSelector的值類型。

參數

source
IQueryable<TSource>

一個 IQueryable<T> 創造一個 Dictionary<TKey,TValue> 。

keySelector
Func<TSource,TKey>

一個用來從每個元素中提取鍵值的函式。

elementSelector
Func<TSource,TElement>

一個轉換函數,從每個元素產生結果元素值。

comparer
IEqualityComparer<TKey>

還有 IEqualityComparer<T> 比較鑰匙。

傳回

Task<Dictionary<TKey,TElement>>

一個代表非同步操作的任務。 任務結果包含 a Dictionary<TKey,TValue> ,該 包含從輸入序列中選擇的值 TElement 。

屬性

備註

不支援在同一上下文實例上進行多個主動操作。 在此上下文中呼叫其他方法前,請使用「wait」以確保所有非同步操作已完成。

適用於

ToDictionaryAsync<TSource,TKey,TElement>(IQueryable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, CancellationToken)

透過非同步列舉,依照指定的鍵選擇器與元素選擇函式,從 建立 a Dictionary<TKey,TValue>IQueryable<T> 。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<TKey,TElement>> ToDictionaryAsync<TSource,TKey,TElement>(this System.Linq.IQueryable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector, System.Threading.CancellationToken cancellationToken);
static member ToDictionaryAsync : System.Linq.IQueryable<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<'Key, 'Element>>

類型參數

TSource

元素 source的類型。

TKey

由 返回 keySelector 的金鑰類型。

TElement

由 返回 elementSelector的值類型。

參數

source
IQueryable<TSource>

一個 IQueryable<T> 創造一個 Dictionary<TKey,TValue> 。

keySelector
Func<TSource,TKey>

一個用來從每個元素中提取鍵值的函式。

elementSelector
Func<TSource,TElement>

一個轉換函數,從每個元素產生結果元素值。

cancellationToken
CancellationToken

A CancellationToken 在等待任務完成時觀察。

傳回

Task<Dictionary<TKey,TElement>>

一個代表非同步操作的任務。 任務結果包含 a Dictionary<TKey,TValue> ,該 包含從輸入序列中選擇的值 TElement 。

屬性

備註

不支援在同一上下文實例上進行多個主動操作。 在此上下文中呼叫其他方法前,請使用「wait」以確保所有非同步操作已完成。

適用於

ToDictionaryAsync<TSource,TKey,TElement>(IQueryable<TSource>, Func<TSource,TKey>, Func<TSource,TElement>, IEqualityComparer<TKey>, CancellationToken)

透過非同步列舉,依照指定的鍵選擇函數、比較器及元素選擇函式,從 和 IQueryable<T> 建立 aDictionary<TKey,TValue>。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<TKey,TElement>> ToDictionaryAsync<TSource,TKey,TElement>(this System.Linq.IQueryable<TSource> source, Func<TSource,TKey> keySelector, Func<TSource,TElement> elementSelector, System.Collections.Generic.IEqualityComparer<TKey> comparer, System.Threading.CancellationToken cancellationToken);
static member ToDictionaryAsync : System.Linq.IQueryable<'Source> * Func<'Source, 'Key> * Func<'Source, 'Element> * System.Collections.Generic.IEqualityComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<'Key, 'Element>>

類型參數

TSource

元素 source的類型。

TKey

由 返回 keySelector 的金鑰類型。

TElement

由 返回 elementSelector的值類型。

參數

source
IQueryable<TSource>

一個 IQueryable<T> 創造一個 Dictionary<TKey,TValue> 。

keySelector
Func<TSource,TKey>

一個用來從每個元素中提取鍵值的函式。

elementSelector
Func<TSource,TElement>

一個轉換函數,從每個元素產生結果元素值。

comparer
IEqualityComparer<TKey>

還有 IEqualityComparer<T> 比較鑰匙。

cancellationToken
CancellationToken

A CancellationToken 在等待任務完成時觀察。

傳回

Task<Dictionary<TKey,TElement>>

一個代表非同步操作的任務。 任務結果包含 a Dictionary<TKey,TValue> ,該 包含從輸入序列中選擇的值 TElement 。

屬性

備註

不支援在同一上下文實例上進行多個主動操作。 在此上下文中呼叫其他方法前,請使用「wait」以確保所有非同步操作已完成。

適用於

ToDictionaryAsync<TSource,TKey>(IQueryable<TSource>, Func<TSource,TKey>)

透過非同步列舉,依照指定的鍵選擇函式從 中IQueryable<T>建立 aDictionary<TKey,TValue>。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<TKey,TSource>> ToDictionaryAsync<TSource,TKey>(this System.Linq.IQueryable<TSource> source, Func<TSource,TKey> keySelector);
static member ToDictionaryAsync : System.Linq.IQueryable<'Source> * Func<'Source, 'Key> -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<'Key, 'Source>>
<Extension()>
Public Function ToDictionaryAsync(Of TSource, TKey) (source As IQueryable(Of TSource), keySelector As Func(Of TSource, TKey)) As Task(Of Dictionary(Of TKey, TSource))

類型參數

TSource

元素 source的類型。

TKey

由 返回 keySelector 的金鑰類型。

參數

source
IQueryable<TSource>

一個 IQueryable<T> 創造一個 Dictionary<TKey,TValue> 。

keySelector
Func<TSource,TKey>

一個用來從每個元素中提取鍵值的函式。

傳回

Task<Dictionary<TKey,TSource>>

一個代表非同步操作的任務。 任務結果包含 Dictionary<TKey,TValue> 包含選取的鍵與值。

屬性

備註

不支援在同一上下文實例上進行多個主動操作。 在此上下文中呼叫其他方法前,請使用「wait」以確保所有非同步操作已完成。

適用於

ToDictionaryAsync<TSource,TKey>(IQueryable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>)

透過非同步列舉,根據指定的金鑰選擇函式與比較器,從 和 IQueryable<T> 建立 。Dictionary<TKey,TValue>

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<TKey,TSource>> ToDictionaryAsync<TSource,TKey>(this System.Linq.IQueryable<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey> comparer);
static member ToDictionaryAsync : System.Linq.IQueryable<'Source> * Func<'Source, 'Key> * System.Collections.Generic.IEqualityComparer<'Key> -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<'Key, 'Source>>
<Extension()>
Public Function ToDictionaryAsync(Of TSource, TKey) (source As IQueryable(Of TSource), keySelector As Func(Of TSource, TKey), comparer As IEqualityComparer(Of TKey)) As Task(Of Dictionary(Of TKey, TSource))

類型參數

TSource

元素 source的類型。

TKey

由 返回 keySelector 的金鑰類型。

參數

source
IQueryable<TSource>

一個 IQueryable<T> 創造一個 Dictionary<TKey,TValue> 。

keySelector
Func<TSource,TKey>

一個用來從每個元素中提取鍵值的函式。

comparer
IEqualityComparer<TKey>

還有 IEqualityComparer<T> 比較鑰匙。

傳回

Task<Dictionary<TKey,TSource>>

一個代表非同步操作的任務。 任務結果包含 Dictionary<TKey,TValue> 包含選取的鍵與值。

屬性

備註

不支援在同一上下文實例上進行多個主動操作。 在此上下文中呼叫其他方法前,請使用「wait」以確保所有非同步操作已完成。

適用於

ToDictionaryAsync<TSource,TKey>(IQueryable<TSource>, Func<TSource,TKey>, CancellationToken)

透過非同步列舉,依照指定的鍵選擇函式從 中IQueryable<T>建立 aDictionary<TKey,TValue>。

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<TKey,TSource>> ToDictionaryAsync<TSource,TKey>(this System.Linq.IQueryable<TSource> source, Func<TSource,TKey> keySelector, System.Threading.CancellationToken cancellationToken);
static member ToDictionaryAsync : System.Linq.IQueryable<'Source> * Func<'Source, 'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<'Key, 'Source>>

類型參數

TSource

元素 source的類型。

TKey

由 返回 keySelector 的金鑰類型。

參數

source
IQueryable<TSource>

一個 IQueryable<T> 創造一個 Dictionary<TKey,TValue> 。

keySelector
Func<TSource,TKey>

一個用來從每個元素中提取鍵值的函式。

cancellationToken
CancellationToken

A CancellationToken 在等待任務完成時觀察。

傳回

Task<Dictionary<TKey,TSource>>

一個代表非同步操作的任務。 任務結果包含 Dictionary<TKey,TValue> 包含選取的鍵與值。

屬性

備註

不支援在同一上下文實例上進行多個主動操作。 在此上下文中呼叫其他方法前,請使用「wait」以確保所有非同步操作已完成。

適用於

ToDictionaryAsync<TSource,TKey>(IQueryable<TSource>, Func<TSource,TKey>, IEqualityComparer<TKey>, CancellationToken)

透過非同步列舉,根據指定的金鑰選擇函式與比較器,從 和 IQueryable<T> 建立 。Dictionary<TKey,TValue>

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public static System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<TKey,TSource>> ToDictionaryAsync<TSource,TKey>(this System.Linq.IQueryable<TSource> source, Func<TSource,TKey> keySelector, System.Collections.Generic.IEqualityComparer<TKey> comparer, System.Threading.CancellationToken cancellationToken);
static member ToDictionaryAsync : System.Linq.IQueryable<'Source> * Func<'Source, 'Key> * System.Collections.Generic.IEqualityComparer<'Key> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<'Key, 'Source>>

類型參數

TSource

元素 source的類型。

TKey

由 返回 keySelector 的金鑰類型。

參數

source
IQueryable<TSource>

一個 IQueryable<T> 創造一個 Dictionary<TKey,TValue> 。

keySelector
Func<TSource,TKey>

一個用來從每個元素中提取鍵值的函式。

comparer
IEqualityComparer<TKey>

還有 IEqualityComparer<T> 比較鑰匙。

cancellationToken
CancellationToken

A CancellationToken 在等待任務完成時觀察。

傳回

Task<Dictionary<TKey,TSource>>

一個代表非同步操作的任務。 任務結果包含 Dictionary<TKey,TValue> 包含選取的鍵與值。

屬性

備註

不支援在同一上下文實例上進行多個主動操作。 在此上下文中呼叫其他方法前,請使用「wait」以確保所有非同步操作已完成。

適用於