Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

QueryableExtensions::ToDictionaryAsync Method

Entity Framework 6.0
 

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function.

Namespace:   System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticToDictionaryAsync<TSource, TKey>(IQueryable<TSource>^, Func<TSource, TKey>^)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function.

System_CAPS_pubmethodSystem_CAPS_staticToDictionaryAsync<TSource, TKey>(IQueryable<TSource>^, Func<TSource, TKey>^, CancellationToken)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function.

System_CAPS_pubmethodSystem_CAPS_staticToDictionaryAsync<TSource, TKey>(IQueryable<TSource>^, Func<TSource, TKey>^, IEqualityComparer<TKey>^)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function and a comparer.

System_CAPS_pubmethodSystem_CAPS_staticToDictionaryAsync<TSource, TKey>(IQueryable<TSource>^, Func<TSource, TKey>^, IEqualityComparer<TKey>^, CancellationToken)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function and a comparer.

System_CAPS_pubmethodSystem_CAPS_staticToDictionaryAsync<TSource, TKey, TElement>(IQueryable<TSource>^, Func<TSource, TKey>^, Func<TSource, TElement>^)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector and an element selector function.

System_CAPS_pubmethodSystem_CAPS_staticToDictionaryAsync<TSource, TKey, TElement>(IQueryable<TSource>^, Func<TSource, TKey>^, Func<TSource, TElement>^, CancellationToken)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector and an element selector function.

System_CAPS_pubmethodSystem_CAPS_staticToDictionaryAsync<TSource, TKey, TElement>(IQueryable<TSource>^, Func<TSource, TKey>^, Func<TSource, TElement>^, IEqualityComparer<TKey>^)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.

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

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.

Return to top

QueryableExtensions::ToDictionaryAsync<TSource, TKey> Method (IQueryable<TSource>^, Func<TSource, TKey>^)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function.

public:
generic<typename TSource, typename TKey>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Dictionary<TKey, TSource>^>^ ToDictionaryAsync(
	IQueryable<TSource>^ source,
	Func<TSource, TKey>^ keySelector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to create a Dictionary<TKey, TValue> from.

keySelector
Type: System::Func<TSource, TKey>^

A function to extract a key from each element.

Return Value

Type: System.Threading.Tasks::Task<Dictionary<TKey, TSource>^>^

A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains selected keys and values.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector .

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top

QueryableExtensions::ToDictionaryAsync<TSource, TKey> Method (IQueryable<TSource>^, Func<TSource, TKey>^, CancellationToken)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function.

public:
generic<typename TSource, typename TKey>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Dictionary<TKey, TSource>^>^ ToDictionaryAsync(
	IQueryable<TSource>^ source,
	Func<TSource, TKey>^ keySelector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to create a Dictionary<TKey, TValue> from.

keySelector
Type: System::Func<TSource, TKey>^

A function to extract a key from each element.

cancellationToken
Type: System.Threading::CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Return Value

Type: System.Threading.Tasks::Task<Dictionary<TKey, TSource>^>^

A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains selected keys and values.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector .

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top

QueryableExtensions::ToDictionaryAsync<TSource, TKey> Method (IQueryable<TSource>^, Func<TSource, TKey>^, IEqualityComparer<TKey>^)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function and a comparer.

public:
generic<typename TSource, typename TKey>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Dictionary<TKey, TSource>^>^ ToDictionaryAsync(
	IQueryable<TSource>^ source,
	Func<TSource, TKey>^ keySelector,
	IEqualityComparer<TKey>^ comparer
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to create a Dictionary<TKey, TValue> from.

keySelector
Type: System::Func<TSource, TKey>^

A function to extract a key from each element.

comparer
Type: System.Collections.Generic::IEqualityComparer<TKey>^

An IEqualityComparer<T> to compare keys.

Return Value

Type: System.Threading.Tasks::Task<Dictionary<TKey, TSource>^>^

A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains selected keys and values.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector .

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top

QueryableExtensions::ToDictionaryAsync<TSource, TKey> Method (IQueryable<TSource>^, Func<TSource, TKey>^, IEqualityComparer<TKey>^, CancellationToken)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function and a comparer.

public:
generic<typename TSource, typename TKey>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Dictionary<TKey, TSource>^>^ ToDictionaryAsync(
	IQueryable<TSource>^ source,
	Func<TSource, TKey>^ keySelector,
	IEqualityComparer<TKey>^ comparer,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to create a Dictionary<TKey, TValue> from.

keySelector
Type: System::Func<TSource, TKey>^

A function to extract a key from each element.

comparer
Type: System.Collections.Generic::IEqualityComparer<TKey>^

An IEqualityComparer<T> to compare keys.

cancellationToken
Type: System.Threading::CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Return Value

Type: System.Threading.Tasks::Task<Dictionary<TKey, TSource>^>^

A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains selected keys and values.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector .

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top

QueryableExtensions::ToDictionaryAsync<TSource, TKey, TElement> Method (IQueryable<TSource>^, Func<TSource, TKey>^, Func<TSource, TElement>^)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector and an element selector function.

public:
generic<typename TSource, typename TKey, typename TElement>
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[ExtensionAttribute]
static Task<Dictionary<TKey, TElement>^>^ ToDictionaryAsync(
	IQueryable<TSource>^ source,
	Func<TSource, TKey>^ keySelector,
	Func<TSource, TElement>^ elementSelector
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to create a Dictionary<TKey, TValue> from.

keySelector
Type: System::Func<TSource, TKey>^

A function to extract a key from each element.

elementSelector
Type: System::Func<TSource, TElement>^

A transform function to produce a result element value from each element.

Return Value

Type: System.Threading.Tasks::Task<Dictionary<TKey, TElement>^>^

A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains values of type TElement selected from the input sequence.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector .

TElement

The type of the value returned by elementSelector.

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top

QueryableExtensions::ToDictionaryAsync<TSource, TKey, TElement> Method (IQueryable<TSource>^, Func<TSource, TKey>^, Func<TSource, TElement>^, CancellationToken)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector and an element selector function.

public:
generic<typename TSource, typename TKey, typename TElement>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Dictionary<TKey, TElement>^>^ ToDictionaryAsync(
	IQueryable<TSource>^ source,
	Func<TSource, TKey>^ keySelector,
	Func<TSource, TElement>^ elementSelector,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to create a Dictionary<TKey, TValue> from.

keySelector
Type: System::Func<TSource, TKey>^

A function to extract a key from each element.

elementSelector
Type: System::Func<TSource, TElement>^

A transform function to produce a result element value from each element.

cancellationToken
Type: System.Threading::CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Return Value

Type: System.Threading.Tasks::Task<Dictionary<TKey, TElement>^>^

A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains values of type TElement selected from the input sequence.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector .

TElement

The type of the value returned by elementSelector.

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top

QueryableExtensions::ToDictionaryAsync<TSource, TKey, TElement> Method (IQueryable<TSource>^, Func<TSource, TKey>^, Func<TSource, TElement>^, IEqualityComparer<TKey>^)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.

public:
generic<typename TSource, typename TKey, typename TElement>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Dictionary<TKey, TElement>^>^ ToDictionaryAsync(
	IQueryable<TSource>^ source,
	Func<TSource, TKey>^ keySelector,
	Func<TSource, TElement>^ elementSelector,
	IEqualityComparer<TKey>^ comparer
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to create a Dictionary<TKey, TValue> from.

keySelector
Type: System::Func<TSource, TKey>^

A function to extract a key from each element.

elementSelector
Type: System::Func<TSource, TElement>^

A transform function to produce a result element value from each element.

comparer
Type: System.Collections.Generic::IEqualityComparer<TKey>^

An IEqualityComparer<T> to compare keys.

Return Value

Type: System.Threading.Tasks::Task<Dictionary<TKey, TElement>^>^

A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains values of type TElement selected from the input sequence.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector .

TElement

The type of the value returned by elementSelector.

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top

QueryableExtensions::ToDictionaryAsync<TSource, TKey, TElement> Method (IQueryable<TSource>^, Func<TSource, TKey>^, Func<TSource, TElement>^, IEqualityComparer<TKey>^, CancellationToken)

Creates a Dictionary<TKey, TValue> from an IQueryable<T> by enumerating it asynchronously according to a specified key selector function, a comparer, and an element selector function.

public:
generic<typename TSource, typename TKey, typename TElement>
[ExtensionAttribute]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
static Task<Dictionary<TKey, TElement>^>^ ToDictionaryAsync(
	IQueryable<TSource>^ source,
	Func<TSource, TKey>^ keySelector,
	Func<TSource, TElement>^ elementSelector,
	IEqualityComparer<TKey>^ comparer,
	CancellationToken cancellationToken
)

Parameters

source
Type: System.Linq::IQueryable<TSource>^

An IQueryable<T> to create a Dictionary<TKey, TValue> from.

keySelector
Type: System::Func<TSource, TKey>^

A function to extract a key from each element.

elementSelector
Type: System::Func<TSource, TElement>^

A transform function to produce a result element value from each element.

comparer
Type: System.Collections.Generic::IEqualityComparer<TKey>^

An IEqualityComparer<T> to compare keys.

cancellationToken
Type: System.Threading::CancellationToken

A CancellationToken to observe while waiting for the task to complete.

Return Value

Type: System.Threading.Tasks::Task<Dictionary<TKey, TElement>^>^

A task that represents the asynchronous operation. The task result contains a Dictionary<TKey, TValue> that contains values of type TElement selected from the input sequence.

Type Parameters

TSource

The type of the elements of source.

TKey

The type of the key returned by keySelector .

TElement

The type of the value returned by elementSelector.

Multiple active operations on the same context instance are not supported. Use 'await' to ensure that any asynchronous operations have completed before calling another method on this context.

Return to top
Show: