,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
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the dictionary key computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence to create a dictionary for. |
keySelector | Expression | A function to extract a key from each element. |
Returns: IQbservable
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source 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
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the dictionary key computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence to create a dictionary for. |
keySelector | Expression | A function to extract a key from each element. |
comparer | IEqualityComparer | An equality comparer to compare keys. |
Returns: IQbservable
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source 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
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the dictionary key computed for each element in the source sequence. |
TElement | The type of the dictionary value computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence to create a dictionary for. |
keySelector | Expression | A function to extract a key from each element. |
elementSelector | Expression | A transform function to produce a result element value from each element. |
Returns: IQbservable
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source 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
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the dictionary key computed for each element in the source sequence. |
TElement | The type of the dictionary value computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | [IQbservable | An observable sequence to create a dictionary for. |
keySelector | Expression | A function to extract a key from each element. |
elementSelector | Expression | A transform function to produce a result element value from each element. |
comparer | IEqualityComparer | An equality comparer to compare keys. |
Returns: IQbservable
Remarks
The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or keySelector or elementSelector or comparer is null. |