EntityFrameworkQueryableExtensions.ToDictionaryAsync 메서드

정의

오버로드

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

Dictionary<TKey,TValue> 지정된 키 선택기 및 요소 선택기 함수에 따라 비동기적으로 열거하여 에서 IQueryable<T> 를 만듭니다.

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

Dictionary<TKey,TValue> 지정된 키 선택기 함수, 비교자 및 요소 선택기 함수에 따라 비동기적으로 열거하여 에서 IQueryable<T> 를 만듭니다.

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

Dictionary<TKey,TValue> 지정된 키 선택기 함수에 따라 비동기적으로 열거하여 에서 IQueryable<T> 을 만듭니다.

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

Dictionary<TKey,TValue> 지정된 키 선택기 함수 및 비교자에 따라 비동기적으로 열거하여 에서 IQueryable<T> 을 만듭니다.

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

Dictionary<TKey,TValue> 지정된 키 선택기 및 요소 선택기 함수에 따라 비동기적으로 열거하여 에서 IQueryable<T> 를 만듭니다.

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 = default);
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>>
<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), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Dictionary(Of TKey, TElement))

형식 매개 변수

TSource

source 요소의 형식입니다.

TKey

keySelector에서 반환하는 키의 형식입니다.

TElement

elementSelector에서 반환하는 값의 형식입니다.

매개 변수

source
IQueryable<TSource>

Dictionary<TKey,TValue>을 만들기 위한 IQueryable<T>입니다.

keySelector
Func<TSource,TKey>

각 요소에서 키를 추출하는 함수입니다.

elementSelector
Func<TSource,TElement>

각 요소를 사용하여 결과 요소 값을 생성할 변형 함수입니다.

cancellationToken
CancellationToken

CancellationToken 작업이 완료 될 때까지 기다리는 동안 관찰할 입니다.

반환

Task<Dictionary<TKey,TElement>>

비동기 작업(operation)을 나타내는 작업(task)입니다. 작업 결과에는 입력 시퀀스에서 선택한 형식 TElement 의 값이 포함된 가 포함 Dictionary<TKey,TValue> 됩니다.

예외

source, keySelector 또는 elementSelectornull인 경우

설명

동일한 컨텍스트 instance 여러 활성 작업은 지원되지 않습니다. 를 사용하여 await 이 컨텍스트에서 다른 메서드를 호출하기 전에 비동기 작업이 완료되었는지 확인합니다. 자세한 내용 및 예제 는 DbContext 스레딩 문제 방지 를 참조하세요.

자세한 내용 및 예제 는 EF Core를 사용하여 데이터 쿼리 를 참조하세요.

적용 대상

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

Dictionary<TKey,TValue> 지정된 키 선택기 함수, 비교자 및 요소 선택기 함수에 따라 비동기적으로 열거하여 에서 IQueryable<T> 를 만듭니다.

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 = default);
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 = default);
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>>
<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), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Dictionary(Of TKey, TElement))

형식 매개 변수

TSource

source 요소의 형식입니다.

TKey

keySelector에서 반환하는 키의 형식입니다.

TElement

elementSelector에서 반환하는 값의 형식입니다.

매개 변수

source
IQueryable<TSource>

Dictionary<TKey,TValue>을 만들기 위한 IQueryable<T>입니다.

keySelector
Func<TSource,TKey>

각 요소에서 키를 추출하는 함수입니다.

elementSelector
Func<TSource,TElement>

각 요소를 사용하여 결과 요소 값을 생성할 변형 함수입니다.

comparer
IEqualityComparer<TKey>

키를 비교할 IEqualityComparer<T>입니다.

cancellationToken
CancellationToken

CancellationToken 작업이 완료 될 때까지 기다리는 동안 관찰할 입니다.

반환

Task<Dictionary<TKey,TElement>>

비동기 작업(operation)을 나타내는 작업(task)입니다. 작업 결과에는 입력 시퀀스에서 선택한 형식 TElement 의 값이 포함된 가 포함 Dictionary<TKey,TValue> 됩니다.

예외

source, keySelector 또는 elementSelectornull인 경우

설명

동일한 컨텍스트 instance 여러 활성 작업은 지원되지 않습니다. 를 사용하여 await 이 컨텍스트에서 다른 메서드를 호출하기 전에 비동기 작업이 완료되었는지 확인합니다. 자세한 내용 및 예제 는 DbContext 스레딩 문제 방지 를 참조하세요.

자세한 내용 및 예제 는 EF Core를 사용하여 데이터 쿼리 를 참조하세요.

적용 대상

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

Dictionary<TKey,TValue> 지정된 키 선택기 함수에 따라 비동기적으로 열거하여 에서 IQueryable<T> 을 만듭니다.

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 = default);
static member ToDictionaryAsync : System.Linq.IQueryable<'Source> * Func<'Source, 'Key> * System.Threading.CancellationToken -> 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), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Dictionary(Of TKey, TSource))

형식 매개 변수

TSource

source 요소의 형식입니다.

TKey

keySelector에서 반환하는 키의 형식입니다.

매개 변수

source
IQueryable<TSource>

Dictionary<TKey,TValue>을 만들기 위한 IQueryable<T>입니다.

keySelector
Func<TSource,TKey>

각 요소에서 키를 추출하는 함수입니다.

cancellationToken
CancellationToken

CancellationToken 작업이 완료 될 때까지 기다리는 동안 관찰할 입니다.

반환

Task<Dictionary<TKey,TSource>>

비동기 작업(operation)을 나타내는 작업(task)입니다. 작업 결과에는 선택한 키와 값이 포함된 가 포함 Dictionary<TKey,TValue> 됩니다.

예외

source 또는 keySelectornull인 경우

설명

동일한 컨텍스트 instance 여러 활성 작업은 지원되지 않습니다. 를 사용하여 await 이 컨텍스트에서 다른 메서드를 호출하기 전에 비동기 작업이 완료되었는지 확인합니다. 자세한 내용 및 예제 는 DbContext 스레딩 문제 방지 를 참조하세요.

자세한 내용 및 예제 는 EF Core를 사용하여 데이터 쿼리 를 참조하세요.

적용 대상

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

Dictionary<TKey,TValue> 지정된 키 선택기 함수 및 비교자에 따라 비동기적으로 열거하여 에서 IQueryable<T> 을 만듭니다.

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 = default);
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>>
<Extension()>
Public Function ToDictionaryAsync(Of TSource, TKey) (source As IQueryable(Of TSource), keySelector As Func(Of TSource, TKey), comparer As IEqualityComparer(Of TKey), Optional cancellationToken As CancellationToken = Nothing) As Task(Of Dictionary(Of TKey, TSource))

형식 매개 변수

TSource

source 요소의 형식입니다.

TKey

keySelector에서 반환하는 키의 형식입니다.

매개 변수

source
IQueryable<TSource>

Dictionary<TKey,TValue>을 만들기 위한 IQueryable<T>입니다.

keySelector
Func<TSource,TKey>

각 요소에서 키를 추출하는 함수입니다.

comparer
IEqualityComparer<TKey>

키를 비교할 IEqualityComparer<T>입니다.

cancellationToken
CancellationToken

CancellationToken 작업이 완료 될 때까지 기다리는 동안 관찰할 입니다.

반환

Task<Dictionary<TKey,TSource>>

비동기 작업(operation)을 나타내는 작업(task)입니다. 작업 결과에는 선택한 키와 값이 포함된 가 포함 Dictionary<TKey,TValue> 됩니다.

예외

source 또는 keySelectornull인 경우

설명

동일한 컨텍스트 instance 여러 활성 작업은 지원되지 않습니다. 를 사용하여 await 이 컨텍스트에서 다른 메서드를 호출하기 전에 비동기 작업이 완료되었는지 확인합니다. 자세한 내용 및 예제 는 DbContext 스레딩 문제 방지 를 참조하세요.

자세한 내용 및 예제 는 EF Core를 사용하여 데이터 쿼리 를 참조하세요.

적용 대상