ODataQuery<TSource, TResult> Class

Builds the OData query options of the entity set of TSource that return results of type TResult computed by $apply. OData applies $apply first, so the Where, OrderBy, Skip and Take of this query work on the results.

Inheritance

Object

ODataQuery<TSource, TResult>

Namespace: Radzen

Assembly: Radzen.Blazor.dll

Syntax

public class ODataQuery<TSource, TResult>

Type Parameters

Name Description
TSourceThe entity type of the entity set.
TResultThe type of the results.

Methods

OrderByLink to this section

Orders the results by keySelector ascending, translated to $orderby. Replaces any earlier ordering.

Declaration
public OrderedODataQuery<TSource, TResult> OrderBy(Expressions.Expression<Func<TResult, TKey>> keySelector)
Parameters
Type Name Description
Expressions.Expression<Func<TResult, TKey>> keySelector A group key or an aggregate of the result.
Returns
Type Description
OrderedODataQuery<TSource, TResult>A new query to which ThenBy adds the next key.

OrderByDescendingLink to this section

Orders the results by keySelector descending, translated to $orderby. Replaces any earlier ordering.

Declaration
public OrderedODataQuery<TSource, TResult> OrderByDescending(Expressions.Expression<Func<TResult, TKey>> keySelector)
Parameters
Type Name Description
Expressions.Expression<Func<TResult, TKey>> keySelector A group key or an aggregate of the result.
Returns
Type Description
OrderedODataQuery<TSource, TResult>A new query to which ThenBy adds the next key.

SkipLink to this section

Skips count results, translated to $skip. Call it once, before Int32).

Declaration
public ODataQuery<TSource, TResult> Skip(int count)
Parameters
Type Name Description
int count The number of results to skip.
Returns
Type Description
ODataQuery<TSource, TResult>A new query with $skip.

TakeLink to this section

Takes at most count results, translated to $top. Call it once.

Declaration
public ODataQuery<TSource, TResult> Take(int count)
Parameters
Type Name Description
int count The number of results to return.
Returns
Type Description
ODataQuery<TSource, TResult>A new query with $top.

ToQueryStringLink to this section

Returns the query options with each value escaped once with String).

Declaration
public string ToQueryString()
Returns
Type Description
stringThe query string without the leading question mark.

ToStringLink to this section

Returns the query options unescaped, e.g. $apply=filter(Refunded ne true)/groupby((Currency),aggregate(Price with sum as TotalPrice)).

Declaration
public override string ToString()
Returns
Type Description
stringThe readable query options.

WhereLink to this section

Filters the results with predicate, translated to a filter(...) transformation after the grouping.

Declaration
public ODataQuery<TSource, TResult> Where(Expressions.Expression<Func<TResult, bool>> predicate)
Parameters
Type Name Description
Expressions.Expression<Func<TResult, bool>> predicate The condition, e.g. total => total.TotalPrice > 100.
Returns
Type Description
ODataQuery<TSource, TResult>A new query with the filter added.

WithCountLink to this section

Requests the count of the results, translated to $count=true.

Declaration
public ODataQuery<TSource, TResult> WithCount()
Returns
Type Description
ODataQuery<TSource, TResult>A new query with $count=true.
An error has occurred. This app may no longer respond until reloaded. Reload 🗙