GroupedODataQuery<TSource, TKey> Class

The entities of TSource grouped by a key of type TKey, which Select turns into results.

Inheritance

Object

GroupedODataQuery<TSource, TKey>

Namespace: Radzen

Assembly: Radzen.Blazor.dll

Syntax

public sealed class GroupedODataQuery<TSource, TKey>

Type Parameters

Name Description
TSourceThe entity type of the entity set.
TKeyThe type of the group key.

Methods

SelectLink to this section

Sets the result of each group, translated to groupby((keys),aggregate(...)). The selector creates a new result and assigns g.Key or the members of a composite key to members of the same names, and the aggregates g.Sum(x => ...), g.Min(x => ...), g.Max(x => ...), g.Average(x => ...), g.Count() and g.Select(x => ...).Distinct().Count() to any members. An aggregated value can be an expression, e.g. g.Sum(x => x.UnitPrice * x.Quantity * (1 - x.Discount)), and a conversion to another numeric type in it, e.g. g.Sum(x => (int)x.Quantity), is sent as cast(Quantity,Edm.Int32).

Declaration
public ODataQuery<TSource, TResult> Select(Expressions.Expression<Func<IGrouping<TKey, TSource>, TResult>> selector)
Parameters
Type Name Description
Expressions.Expression<Func<IGrouping<TKey, TSource>, TResult>> selector The result, e.g. g => new LicenseTotal { Currency = g.Key, TotalPrice = g.Sum(license => license.Price) }.
Returns
Type Description
ODataQuery<TSource, TResult>A query of the results.
An error has occurred. This app may no longer respond until reloaded. Reload 🗙