Skip to content

,System.Linq.Expressions.Expression{System.Func{--0,--1}})} ,System.Linq.Expressions.Expression{System.Func{--0,--1}},System.Collections.Generic.IEqualityComparer{--1})} ,System.Linq.Expressions.Expression{System.Func{--0,--1}},System.Linq.Expressions.Expression{System.Func{--0,--2}})} ,System.Linq.Expressions.Expression{System.Func{--0,--1}},System.Linq.Expressions.Expression{System.Func{--0,--2}},System.Collections.Generic.IEqualityComparer{--1})}

Qbservable.ToDictionary(IQbservable, Expression>) method

Defined in

Type: Qbservable Namespace: System.Reactive.Linq Assembly: System.Reactive.dll

Applies to

netstandard2.0

Overloads

  • 1. public static IQbservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector) where TKey : notnull
  • 2. public static IQbservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer) where TKey : notnull
  • 3. public static IQbservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector) where TKey : notnull
  • 4. public static IQbservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> comparer) where TKey : notnull

1. Overload

public static IQbservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector) where TKey : notnull

Summary: Creates a dictionary from an observable sequence according to a specified key selector function.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TKeyThe type of the dictionary key computed for each element in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#An observable sequence to create a dictionary for.
keySelectorExpression>A function to extract a key from each element.

Returns: IQbservable> -- An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or keySelector is null.

2. Overload

public static IQbservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IEqualityComparer<TKey> comparer) where TKey : notnull

Summary: Creates a dictionary from an observable sequence according to a specified key selector function, and a comparer.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TKeyThe type of the dictionary key computed for each element in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#An observable sequence to create a dictionary for.
keySelectorExpression>A function to extract a key from each element.
comparerIEqualityComparerAn equality comparer to compare keys.

Returns: IQbservable> -- An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or keySelector or comparer is null.

3. Overload

public static IQbservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector) where TKey : notnull

Summary: Creates a dictionary from an observable sequence according to a specified key selector function, and an element selector function.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TKeyThe type of the dictionary key computed for each element in the source sequence.
TElementThe type of the dictionary value computed for each element in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#An observable sequence to create a dictionary for.
keySelectorExpression>A function to extract a key from each element.
elementSelectorExpression>A transform function to produce a result element value from each element.

Returns: IQbservable> -- An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or keySelector or elementSelector is null.

4. Overload

public static IQbservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IQbservable<TSource> source, Expression<Func<TSource, TKey>> keySelector, Expression<Func<TSource, TElement>> elementSelector, IEqualityComparer<TKey> comparer) where TKey : notnull

Summary: Creates a dictionary from an observable sequence according to a specified key selector function, a comparer, and an element selector function.

Type parameters

NameDescription
TSourceThe type of the elements in the source sequence.
TKeyThe type of the dictionary key computed for each element in the source sequence.
TElementThe type of the dictionary value computed for each element in the source sequence.

Parameters

NameTypeDescription
source[IQbservable](#An observable sequence to create a dictionary for.
keySelectorExpression>A function to extract a key from each element.
elementSelectorExpression>A transform function to produce a result element value from each element.
comparerIEqualityComparerAn equality comparer to compare keys.

Returns: IQbservable> -- An observable sequence containing a single element with a dictionary mapping unique key values onto the corresponding source sequence's element.

Remarks

The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.

Exceptions

TypeCondition
System.ArgumentNullExceptionsource or keySelector or elementSelector or comparer is null.