,System.Func{--0,--1})} ,System.Func{--0,--1},System.Collections.Generic.IEqualityComparer{--1})} ,System.Func{--0,--1},System.Func{--0,--2})} ,System.Func{--0,--1},System.Func{--0,--2},System.Collections.Generic.IEqualityComparer{--1})} ,System.Func{--0,--1},System.Int32)} ,System.Func{--0,--1},System.Int32,System.Collections.Generic.IEqualityComparer{--1})} ,System.Func{--0,--1},System.Func{--0,--2},System.Int32)} ,System.Func{--0,--1},System.Func{--0,--2},System.Int32,System.Collections.Generic.IEqualityComparer{--1})}
Observable.GroupBy(IObservable, Func) method¶
Defined in
Type: Observable
Namespace: System.Reactive.Linq
Assembly: System.Reactive.dll
Applies to
netstandard2.0
Overloads¶
- 1.
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector) - 2.
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer) - 3.
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector) - 4.
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) - 5.
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, int capacity) - 6.
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, int capacity, IEqualityComparer<TKey> comparer) - 7.
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, int capacity) - 8.
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, int capacity, IEqualityComparer<TKey> comparer)
1. Overload¶
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
Summary: Groups the elements of 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 grouping key computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to group. |
keySelector | Func | A function to extract the key for each element. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or keySelector is null. |
2. Overload¶
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
Summary: Groups the elements of an observable sequence according to a specified key selector function and comparer.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to group. |
keySelector | Func | A function to extract the key for each element. |
comparer | IEqualityComparer | An equality comparer to compare keys with. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or keySelector or comparer is null. |
3. Overload¶
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector)
Summary: Groups the elements of an observable sequence and selects the resulting elements by using a specified function.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to group. |
keySelector | Func | A function to extract the key for each element. |
elementSelector | Func | A function to map each source element to an element in an observable group. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or keySelector or elementSelector is null. |
4. Overload¶
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer)
Summary: Groups the elements of an observable sequence according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to group. |
keySelector | Func | A function to extract the key for each element. |
elementSelector | Func | A function to map each source element to an element in an observable group. |
comparer | IEqualityComparer | An equality comparer to compare keys with. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or keySelector or elementSelector or comparer is null. |
5. Overload¶
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, int capacity)
Summary: Groups the elements of an observable sequence with the specified initial capacity 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 grouping key computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to group. |
keySelector | Func | A function to extract the key for each element. |
capacity | int | The initial number of elements that the underlying dictionary can contain. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or keySelector is null. |
| System.ArgumentOutOfRangeException | capacity is less than 0. |
6. Overload¶
public static IObservable<IGroupedObservable<TKey, TSource>> GroupBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, int capacity, IEqualityComparer<TKey> comparer)
Summary: Groups the elements of an observable sequence with the specified initial capacity according to a specified key selector function and comparer.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to group. |
keySelector | Func | A function to extract the key for each element. |
capacity | int | The initial number of elements that the underlying dictionary can contain. |
comparer | IEqualityComparer | An equality comparer to compare keys with. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or keySelector or comparer is null. |
| System.ArgumentOutOfRangeException | capacity is less than 0. |
7. Overload¶
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, int capacity)
Summary: Groups the elements of an observable sequence with the specified initial capacity and selects the resulting elements by using a specified function.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to group. |
keySelector | Func | A function to extract the key for each element. |
elementSelector | Func | A function to map each source element to an element in an observable group. |
capacity | int | The initial number of elements that the underlying dictionary can contain. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or keySelector or elementSelector is null. |
| System.ArgumentOutOfRangeException | capacity is less than 0. |
8. Overload¶
public static IObservable<IGroupedObservable<TKey, TElement>> GroupBy<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, int capacity, IEqualityComparer<TKey> comparer)
Summary: Groups the elements of an observable sequence with the specified initial capacity according to a specified key selector function and comparer and selects the resulting elements by using a specified function.
Type parameters
| Name | Description |
|---|---|
TSource | The type of the elements in the source sequence. |
TKey | The type of the grouping key computed for each element in the source sequence. |
TElement | The type of the elements within the groups computed for each element in the source sequence. |
Parameters
| Name | Type | Description |
|---|---|---|
source | IObservable | An observable sequence whose elements to group. |
keySelector | Func | A function to extract the key for each element. |
elementSelector | Func | A function to map each source element to an element in an observable group. |
capacity | int | The initial number of elements that the underlying dictionary can contain. |
comparer | IEqualityComparer | An equality comparer to compare keys with. |
Returns: IObservable
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | source or keySelector or elementSelector or comparer is null. |
| System.ArgumentOutOfRangeException | capacity is less than 0. |