Table of Contents

Class EntityBuilderExtensions

Namespace
NextORM.Core
Assembly
nextorm.core.dll

Terminal operators for EntityBuilder<TEntity>. They are extension methods so the builder itself stays a focused query-shaping type; each one simply forwards to the command it builds. Call sites are unchanged (instance-style invocation still resolves here).

public static class EntityBuilderExtensions
Inheritance
EntityBuilderExtensions
Inherited Members

Methods

AnyAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Determines asynchronously whether the query matches at least one row.

public static Task<bool> AnyAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<bool>

A task whose result is true if the query matches at least one row; otherwise, false.

Type Parameters

TEntity

The entity type being queried.

AnyAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Determines asynchronously whether the query matches at least one row.

public static Task<bool> AnyAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<bool>

A task whose result is true if the query matches at least one row; otherwise, false.

Type Parameters

TEntity

The entity type being queried.

AnyCommand<TEntity>(EntityBuilder<TEntity>)

Builds the command that evaluates whether the query matches any rows.

public static QueryCommand<bool> AnyCommand<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

QueryCommand<bool>

The command that evaluates EXISTS for the query.

Type Parameters

TEntity

The entity type being queried.

Any<TEntity>(EntityBuilder<TEntity>)

Determines whether the query matches at least one row.

public static bool Any<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

bool

true if the query matches at least one row; otherwise, false.

Type Parameters

TEntity

The entity type being queried.

Any<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Determines whether the query matches at least one row.

public static bool Any<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

bool

true if the query matches at least one row; otherwise, false.

Type Parameters

TEntity

The entity type being queried.

AsEntityBuilder<T>(IEnumerable<T>)

Adapts a declared collection navigation to a full EntityBuilder<TEntity> so it can be composed like any other query, for example e.Children.AsEntityBuilder().Where(c => c.IsActive).Any().

public static EntityBuilder<T> AsEntityBuilder<T>(this IEnumerable<T> source) where T : class

Parameters

source IEnumerable<T>

The declared collection navigation to adapt.

Returns

EntityBuilder<T>

Never returns; the call is only valid inside a query expression.

Type Parameters

T

The related entity type; must be a reference type.

Remarks

This is an expression-only marker: it must appear inside a query expression tree, where the translator resolves the receiver to the declared navigation path rooted in the surrounding query. Calling it as an ordinary method (outside an expression tree) always throws NotSupportedException; it never returns a default or a null marker. Captured receivers and undeclared navigations are not supported.

Exceptions

NotSupportedException

Always, when called outside a query expression tree.

AsEntityBuilder<T>(object?)

Adapts a declared reference navigation to a full EntityBuilder<TEntity> so it can be composed like any other query, for example e.Parent!.AsEntityBuilder<Parent>().Where(p => p.IsActive).Any().

public static EntityBuilder<T> AsEntityBuilder<T>(this object? navigation) where T : class

Parameters

navigation object

The declared reference navigation to adapt.

Returns

EntityBuilder<T>

Never returns; the call is only valid inside a query expression.

Type Parameters

T

The related entity type; must be a reference type.

Remarks

This is the reference-navigation counterpart of the collection overload. The generic argument must be supplied explicitly because the receiver is typed as object; the collection overload wins when the receiver is a collection, so this form never steals collection calls. Like the collection form it is an expression-only marker and always throws NotSupportedException outside a query expression tree.

Exceptions

NotSupportedException

Always, when called outside a query expression tree.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, byte>>, params object[])

Computes the average of the projected byte values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, byte>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, byte>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, byte>>, CancellationToken, params object[])

Computes the average of the projected byte values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, byte>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, byte>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, decimal>>, params object[])

Computes the average of the projected decimal values as a fractional decimal; null values are ignored.

public static Task<decimal?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, decimal>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, decimal>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<decimal?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, decimal>>, CancellationToken, params object[])

Computes the average of the projected decimal values as a fractional decimal; null values are ignored.

public static Task<decimal?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, decimal>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, decimal>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<decimal?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, double>>, params object[])

Computes the average of the projected double values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, double>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, double>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, double>>, CancellationToken, params object[])

Computes the average of the projected double values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, double>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, double>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, short>>, params object[])

Computes the average of the projected short values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, short>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, short>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, short>>, CancellationToken, params object[])

Computes the average of the projected short values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, short>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, short>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, int>>, params object[])

Computes the average of the projected int values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, int>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, int>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, int>>, CancellationToken, params object[])

Computes the average of the projected int values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, int>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, int>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, long>>, params object[])

Computes the average of the projected long values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, long>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, long>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, long>>, CancellationToken, params object[])

Computes the average of the projected long values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, long>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, long>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, byte?>>, params object[])

Computes the average of the projected nullable byte values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, byte?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, byte?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, byte?>>, CancellationToken, params object[])

Computes the average of the projected nullable byte values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, byte?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, byte?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, decimal?>>, params object[])

Computes the average of the projected nullable decimal values as a fractional decimal; null values are ignored.

public static Task<decimal?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, decimal?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, decimal?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<decimal?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, decimal?>>, CancellationToken, params object[])

Computes the average of the projected nullable decimal values as a fractional decimal; null values are ignored.

public static Task<decimal?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, decimal?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, decimal?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<decimal?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, double?>>, params object[])

Computes the average of the projected nullable double values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, double?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, double?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, double?>>, CancellationToken, params object[])

Computes the average of the projected nullable double values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, double?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, double?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, short?>>, params object[])

Computes the average of the projected nullable short values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, short?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, short?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, short?>>, CancellationToken, params object[])

Computes the average of the projected nullable short values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, short?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, short?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, int?>>, params object[])

Computes the average of the projected nullable int values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, int?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, int?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, int?>>, CancellationToken, params object[])

Computes the average of the projected nullable int values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, int?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, int?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, long?>>, params object[])

Computes the average of the projected nullable long values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, long?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, long?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, long?>>, CancellationToken, params object[])

Computes the average of the projected nullable long values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, long?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, long?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, sbyte?>>, params object[])

Computes the average of the projected nullable sbyte values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, sbyte?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, sbyte?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, sbyte?>>, CancellationToken, params object[])

Computes the average of the projected nullable sbyte values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, sbyte?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, sbyte?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, float?>>, params object[])

Computes the average of the projected nullable float values as a fractional float; null values are ignored.

public static Task<float?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, float?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, float?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<float?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, float?>>, CancellationToken, params object[])

Computes the average of the projected nullable float values as a fractional float; null values are ignored.

public static Task<float?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, float?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, float?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<float?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ushort?>>, params object[])

Computes the average of the projected nullable ushort values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ushort?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ushort?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ushort?>>, CancellationToken, params object[])

Computes the average of the projected nullable ushort values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ushort?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ushort?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, uint?>>, params object[])

Computes the average of the projected nullable uint values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, uint?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, uint?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, uint?>>, CancellationToken, params object[])

Computes the average of the projected nullable uint values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, uint?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, uint?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ulong?>>, params object[])

Computes the average of the projected nullable ulong values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ulong?>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ulong?>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ulong?>>, CancellationToken, params object[])

Computes the average of the projected nullable ulong values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ulong?>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ulong?>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, sbyte>>, params object[])

Computes the average of the projected sbyte values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, sbyte>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, sbyte>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, sbyte>>, CancellationToken, params object[])

Computes the average of the projected sbyte values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, sbyte>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, sbyte>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, float>>, params object[])

Computes the average of the projected float values as a fractional float; null values are ignored.

public static Task<float?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, float>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, float>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<float?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, float>>, CancellationToken, params object[])

Computes the average of the projected float values as a fractional float; null values are ignored.

public static Task<float?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, float>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, float>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<float?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ushort>>, params object[])

Computes the average of the projected ushort values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ushort>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ushort>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ushort>>, CancellationToken, params object[])

Computes the average of the projected ushort values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ushort>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ushort>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, uint>>, params object[])

Computes the average of the projected uint values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, uint>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, uint>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, uint>>, CancellationToken, params object[])

Computes the average of the projected uint values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, uint>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, uint>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ulong>>, params object[])

Computes the average of the projected ulong values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ulong>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ulong>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

AvgAsync<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ulong>>, CancellationToken, params object[])

Computes the average of the projected ulong values as a fractional double; null values are ignored.

public static Task<double?> AvgAsync<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ulong>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ulong>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<double?>

A task whose result is the average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, byte>>)

Computes the average of the projected byte values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, byte>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, byte>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, byte>>, params ReadOnlySpan<object?>)

Computes the average of the projected byte values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, byte>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, byte>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, decimal>>)

Computes the average of the projected decimal values as a fractional decimal; null values are ignored.

public static decimal? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, decimal>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, decimal>>

An expression selecting the values to aggregate.

Returns

decimal?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, decimal>>, params ReadOnlySpan<object?>)

Computes the average of the projected decimal values as a fractional decimal; null values are ignored.

public static decimal? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, decimal>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, decimal>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

decimal?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, double>>)

Computes the average of the projected double values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, double>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, double>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, double>>, params ReadOnlySpan<object?>)

Computes the average of the projected double values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, double>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, double>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, short>>)

Computes the average of the projected short values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, short>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, short>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, short>>, params ReadOnlySpan<object?>)

Computes the average of the projected short values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, short>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, short>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, int>>)

Computes the average of the projected int values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, int>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, int>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, int>>, params ReadOnlySpan<object?>)

Computes the average of the projected int values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, int>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, int>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, long>>)

Computes the average of the projected long values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, long>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, long>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, long>>, params ReadOnlySpan<object?>)

Computes the average of the projected long values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, long>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, long>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, byte?>>)

Computes the average of the projected nullable byte values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, byte?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, byte?>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, byte?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable byte values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, byte?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, byte?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, decimal?>>)

Computes the average of the projected nullable decimal values as a fractional decimal; null values are ignored.

public static decimal? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, decimal?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, decimal?>>

An expression selecting the values to aggregate.

Returns

decimal?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, decimal?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable decimal values as a fractional decimal; null values are ignored.

public static decimal? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, decimal?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, decimal?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

decimal?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, double?>>)

Computes the average of the projected nullable double values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, double?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, double?>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, double?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable double values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, double?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, double?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, short?>>)

Computes the average of the projected nullable short values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, short?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, short?>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, short?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable short values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, short?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, short?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, int?>>)

Computes the average of the projected nullable int values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, int?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, int?>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, int?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable int values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, int?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, int?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, long?>>)

Computes the average of the projected nullable long values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, long?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, long?>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, long?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable long values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, long?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, long?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, sbyte?>>)

Computes the average of the projected nullable sbyte values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, sbyte?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, sbyte?>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, sbyte?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable sbyte values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, sbyte?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, sbyte?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, float?>>)

Computes the average of the projected nullable float values as a fractional float; null values are ignored.

public static float? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, float?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, float?>>

An expression selecting the values to aggregate.

Returns

float?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, float?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable float values as a fractional float; null values are ignored.

public static float? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, float?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, float?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

float?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ushort?>>)

Computes the average of the projected nullable ushort values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ushort?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ushort?>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ushort?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable ushort values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ushort?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ushort?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, uint?>>)

Computes the average of the projected nullable uint values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, uint?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, uint?>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, uint?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable uint values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, uint?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, uint?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ulong?>>)

Computes the average of the projected nullable ulong values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ulong?>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ulong?>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ulong?>>, params ReadOnlySpan<object?>)

Computes the average of the projected nullable ulong values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ulong?>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ulong?>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, sbyte>>)

Computes the average of the projected sbyte values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, sbyte>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, sbyte>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, sbyte>>, params ReadOnlySpan<object?>)

Computes the average of the projected sbyte values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, sbyte>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, sbyte>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, float>>)

Computes the average of the projected float values as a fractional float; null values are ignored.

public static float? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, float>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, float>>

An expression selecting the values to aggregate.

Returns

float?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, float>>, params ReadOnlySpan<object?>)

Computes the average of the projected float values as a fractional float; null values are ignored.

public static float? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, float>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, float>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

float?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ushort>>)

Computes the average of the projected ushort values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ushort>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ushort>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ushort>>, params ReadOnlySpan<object?>)

Computes the average of the projected ushort values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ushort>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ushort>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, uint>>)

Computes the average of the projected uint values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, uint>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, uint>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, uint>>, params ReadOnlySpan<object?>)

Computes the average of the projected uint values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, uint>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, uint>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ulong>>)

Computes the average of the projected ulong values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ulong>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ulong>>

An expression selecting the values to aggregate.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

Avg<TEntity>(EntityBuilder<TEntity>, Expression<Func<TEntity, ulong>>, params ReadOnlySpan<object?>)

Computes the average of the projected ulong values as a fractional double; null values are ignored.

public static double? Avg<TEntity>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, ulong>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, ulong>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

double?

The average of the projected values, or null when there is no non-null value.

Type Parameters

TEntity

The entity type being queried.

BindEntity<TEntity>(EntityBuilder<TableAlias>, IReadOnlyCollection<string>)

Binds a direct raw source (FromSql(IDataContext, string, object?) or From(IDataContext, string)) to an entity type so its global query filters may be applied to the source. TEntity selects the effective metadata (a configured mapping wins over the auto mapping).

The caller also declares the output columns the raw SQL exposes; each filter is applied best-effort against that list, and a filter whose columns are missing is skipped rather than failing the query. Binding neither adds nor renames output columns and is not a security guarantee: a skipped filter means its predicate does not run.

Only direct named/raw sources qualify, and the call must be the first operation after the source is created (before predicates, projection or joins). The receiver is not mutated; a new typed builder is returned.

Binding is self-sufficient: it registers TEntity's mapping on the context through the same path as From<TEntity>(), so typed member projections and entity materialization work with no prior From<TEntity>. The registration is process-wide, exactly like From<TEntity>(); a repeated bind is a no-op. A mapping already configured with From<TEntity>(cfg) is preserved (the configured mapping wins over the auto mapping), so register a custom mapping before binding when one is needed.

A filter whose declared columns are all present is injected; a filter with missing columns is skipped rather than failing the query. With an empty declared-column list, a filter with a proven zero-column dependency is applied, while a column-dependent or undetermined filter is skipped. One RawSourceFilterSkipped warning is logged per skipped filter on the NextORM.QueryFilters category (level Warning, reasons MissingColumns / UndeterminedColumns; the missing names are the physical mapped column names) while a plan is prepared on a cache miss; a cache hit does not re-emit it. The message carries no SQL text, table names, parameter or captured values.

public static EntityBuilder<TEntity> BindEntity<TEntity>(this EntityBuilder<TableAlias> source, IReadOnlyCollection<string> availableColumns)

Parameters

source EntityBuilder<TableAlias>

The direct raw/named source builder created by FromSql or From(string). The receiver must not be composed: a predicate, projection, join or other query operator rejects the call. A CTE declaration (Ctes) or a derived-table sub-query hint (SubQueryHint) is source metadata, not composition, and does not disqualify the binding.

availableColumns IReadOnlyCollection<string>

The output columns the raw source exposes; names are compared case-insensitively.

Returns

EntityBuilder<TEntity>

A new typed builder over the same raw source, carrying the binding.

Type Parameters

TEntity

The mapped entity type whose metadata and filters are used.

Exceptions

ArgumentNullException

source or availableColumns is null.

ArgumentException

availableColumns contains a null or blank entry.

NotSupportedException

The receiver is not a direct raw/named source, or TEntity is exactly TableAlias (a mapped subclass of TableAlias is accepted).

InvalidOperationException

The source has already been composed (predicate, projection, join or another query operator).

CountAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Counts the matching rows asynchronously by emitting a SQL COUNT(*).

public static Task<int> CountAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<int>

A task whose result is the number of matching rows.

Type Parameters

TEntity

The entity type being queried.

CountAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Counts the matching rows asynchronously by emitting a SQL COUNT(*).

public static Task<int> CountAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<int>

A task whose result is the number of matching rows.

Type Parameters

TEntity

The entity type being queried.

Count<TEntity>(EntityBuilder<TEntity>)

Counts the matching rows by emitting a SQL COUNT(*).

public static int Count<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

int

The number of matching rows.

Type Parameters

TEntity

The entity type being queried.

Count<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Counts the matching rows by emitting a SQL COUNT(*).

public static int Count<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

int

The number of matching rows.

Type Parameters

TEntity

The entity type being queried.

FirstAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Returns the first matching entity asynchronously and throws when the query is empty.

public static Task<TEntity> FirstAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the first matching entity.

Type Parameters

TEntity

The entity type being queried.

FirstAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Returns the first matching entity asynchronously and throws when the query is empty.

public static Task<TEntity> FirstAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the first matching entity.

Type Parameters

TEntity

The entity type being queried.

FirstOrDefaultAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Returns the first matching entity asynchronously, or the default value when the query is empty.

public static Task<TEntity?> FirstOrDefaultAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the first matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

FirstOrDefaultAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Returns the first matching entity asynchronously, or the default value when the query is empty.

public static Task<TEntity?> FirstOrDefaultAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the first matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

FirstOrDefault<TEntity>(EntityBuilder<TEntity>)

Returns the first matching entity, or the default value when the query is empty.

public static TEntity? FirstOrDefault<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

TEntity

The first matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

FirstOrDefault<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Returns the first matching entity, or the default value when the query is empty.

public static TEntity? FirstOrDefault<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TEntity

The first matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

FirstOrFirstOrDefaultCommand<TEntity>(EntityBuilder<TEntity>)

Builds a command that requests at most one row, shared by First and FirstOrDefault.

public static QueryCommand<TEntity?> FirstOrFirstOrDefaultCommand<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

QueryCommand<TEntity>

A command that requests at most one row.

Type Parameters

TEntity

The entity type being queried.

FirstOrFirstOrDefaultCommand<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Builds a command that requests at most one row, shared by First and FirstOrDefault.

public static QueryCommand<TResult?> FirstOrFirstOrDefaultCommand<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to project.

Returns

QueryCommand<TResult>

A command that requests at most one row.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

First<TEntity>(EntityBuilder<TEntity>)

Returns the first matching entity and throws when the query is empty.

public static TEntity First<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

TEntity

The first matching entity.

Type Parameters

TEntity

The entity type being queried.

First<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Returns the first matching entity and throws when the query is empty.

public static TEntity First<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TEntity

The first matching entity.

Type Parameters

TEntity

The entity type being queried.

LastAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Returns the last matching entity asynchronously and throws when the query is empty.

public static Task<TEntity> LastAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the last matching entity.

Type Parameters

TEntity

The entity type being queried.

LastAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Returns the last matching entity asynchronously and throws when the query is empty.

public static Task<TEntity> LastAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the last matching entity.

Type Parameters

TEntity

The entity type being queried.

LastOrDefaultAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Returns the last matching entity asynchronously, or the default value when the query is empty.

public static Task<TEntity?> LastOrDefaultAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the last matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

LastOrDefaultAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Returns the last matching entity asynchronously, or the default value when the query is empty.

public static Task<TEntity?> LastOrDefaultAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the last matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

LastOrDefault<TEntity>(EntityBuilder<TEntity>)

Returns the last matching entity, or the default value when the query is empty.

public static TEntity? LastOrDefault<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

TEntity

The last matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

LastOrDefault<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Returns the last matching entity, or the default value when the query is empty.

public static TEntity? LastOrDefault<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TEntity

The last matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

Last<TEntity>(EntityBuilder<TEntity>)

Returns the last matching entity and throws when the query is empty.

public static TEntity Last<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

TEntity

The last matching entity.

Type Parameters

TEntity

The entity type being queried.

Last<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Returns the last matching entity and throws when the query is empty.

public static TEntity Last<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TEntity

The last matching entity.

Type Parameters

TEntity

The entity type being queried.

LongCountAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Counts the matching rows as a 64-bit value asynchronously by emitting a SQL COUNT_BIG(*).

public static Task<long> LongCountAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<long>

A task whose result is the number of matching rows as a 64-bit integer.

Type Parameters

TEntity

The entity type being queried.

LongCountAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Counts the matching rows as a 64-bit value asynchronously by emitting a SQL COUNT_BIG(*).

public static Task<long> LongCountAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<long>

A task whose result is the number of matching rows as a 64-bit integer.

Type Parameters

TEntity

The entity type being queried.

LongCount<TEntity>(EntityBuilder<TEntity>)

Counts the matching rows as a 64-bit value by emitting a SQL COUNT_BIG() (COUNT() surfaced as long on providers without a separate 64-bit count function).

public static long LongCount<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

long

The number of matching rows as a 64-bit integer.

Type Parameters

TEntity

The entity type being queried.

LongCount<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Counts the matching rows as a 64-bit value by emitting a SQL COUNT_BIG(*).

public static long LongCount<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

long

The number of matching rows as a 64-bit integer.

Type Parameters

TEntity

The entity type being queried.

MaxAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params object[])

Computes the maximum of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> MaxAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult>

A task whose result is the maximum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

MaxAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, CancellationToken, params object[])

Computes the maximum of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> MaxAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult>

A task whose result is the maximum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

Max<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Computes the maximum of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Max<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

Returns

TResult

The maximum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

Max<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params ReadOnlySpan<object?>)

Computes the maximum of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Max<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult

The maximum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

MinAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params object[])

Computes the minimum of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> MinAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult>

A task whose result is the minimum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

MinAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, CancellationToken, params object[])

Computes the minimum of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> MinAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult>

A task whose result is the minimum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

Min<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Computes the minimum of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Min<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

Returns

TResult

The minimum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

Min<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params ReadOnlySpan<object?>)

Computes the minimum of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Min<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult

The minimum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

Prepare<TEntity>(EntityBuilder<TEntity>, PrepareOptions, CancellationToken)

Creates a command with its SQL already compiled so it can be executed repeatedly, typically with different parameters.

public static IPreparedQueryCommand<TEntity> Prepare<TEntity>(this EntityBuilder<TEntity> builder, PrepareOptions options = default, CancellationToken cancellationToken = default)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

options PrepareOptions

How the prepared command reuses its underlying command and whether rows are streamed. The default value prepares a buffered command whose underlying command is reused per connection.

cancellationToken CancellationToken

A token used to cancel the operation.

Returns

IPreparedQueryCommand<TEntity>

The prepared query command.

Type Parameters

TEntity

The entity type being queried.

Exceptions

ArgumentOutOfRangeException

options carries a PreparedCommandCache value that is not defined.

SingleAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Returns the only matching entity asynchronously and throws when the query returns zero or more than one row.

public static Task<TEntity> SingleAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the single matching entity.

Type Parameters

TEntity

The entity type being queried.

SingleAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Returns the only matching entity asynchronously and throws when the query returns zero or more than one row.

public static Task<TEntity> SingleAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the single matching entity.

Type Parameters

TEntity

The entity type being queried.

SingleOrDefaultAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Returns the only matching entity asynchronously, or the default value when the query is empty; throws when it returns more than one row.

public static Task<TEntity?> SingleOrDefaultAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the single matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

SingleOrDefaultAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Returns the only matching entity asynchronously, or the default value when the query is empty; throws when it returns more than one row.

public static Task<TEntity?> SingleOrDefaultAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity>

A task whose result is the single matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

SingleOrDefault<TEntity>(EntityBuilder<TEntity>)

Returns the only matching entity, or the default value when the query is empty; throws when it returns more than one row.

public static TEntity? SingleOrDefault<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

TEntity

The single matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

SingleOrDefault<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Returns the only matching entity, or the default value when the query is empty; throws when it returns more than one row.

public static TEntity? SingleOrDefault<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TEntity

The single matching entity, or the default value when the query is empty.

Type Parameters

TEntity

The entity type being queried.

SingleOrSingleOrDefaultCommand<TEntity>(EntityBuilder<TEntity>)

Builds a command that requests at most two rows, enough to tell Single from SingleOrDefault at execution time.

public static QueryCommand<TEntity> SingleOrSingleOrDefaultCommand<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

QueryCommand<TEntity>

A command that requests at most two rows.

Type Parameters

TEntity

The entity type being queried.

SingleOrSingleOrDefaultCommand<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Builds a command that requests at most two rows, enough to tell Single from SingleOrDefault at execution time.

public static QueryCommand<TResult?> SingleOrSingleOrDefaultCommand<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to project.

Returns

QueryCommand<TResult>

A command that requests at most two rows.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

Single<TEntity>(EntityBuilder<TEntity>)

Returns the only matching entity and throws when the query returns zero or more than one row.

public static TEntity Single<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

TEntity

The single matching entity.

Type Parameters

TEntity

The entity type being queried.

Single<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Returns the only matching entity and throws when the query returns zero or more than one row.

public static TEntity Single<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TEntity

The single matching entity.

Type Parameters

TEntity

The entity type being queried.

StdevAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, params object[])

Computes the sample standard deviation of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> StdevAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the sample standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

StdevAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, CancellationToken, params object[])

Computes the sample standard deviation of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> StdevAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, CancellationToken cancellationToken, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the sample standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

StdevAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params object[])

Computes the sample standard deviation of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> StdevAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the sample standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

StdevAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, CancellationToken, params object[])

Computes the sample standard deviation of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> StdevAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, CancellationToken cancellationToken, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the sample standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

Stdev<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>)

Computes the sample standard deviation of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Stdev<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

Returns

TResult?

The sample standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

Stdev<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, params ReadOnlySpan<object?>)

Computes the sample standard deviation of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Stdev<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, params ReadOnlySpan<object?> @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult?

The sample standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

Stdev<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Computes the sample standard deviation of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Stdev<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

Returns

TResult?

The sample standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

Stdev<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params ReadOnlySpan<object?>)

Computes the sample standard deviation of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Stdev<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params ReadOnlySpan<object?> @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult?

The sample standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

StdevpAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, params object[])

Computes the population standard deviation of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> StdevpAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the population standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

StdevpAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, CancellationToken, params object[])

Computes the population standard deviation of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> StdevpAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, CancellationToken cancellationToken, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the population standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

StdevpAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params object[])

Computes the population standard deviation of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> StdevpAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the population standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

StdevpAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, CancellationToken, params object[])

Computes the population standard deviation of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> StdevpAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, CancellationToken cancellationToken, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the population standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

Stdevp<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>)

Computes the population standard deviation of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Stdevp<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

Returns

TResult?

The population standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

Stdevp<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, params ReadOnlySpan<object?>)

Computes the population standard deviation of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Stdevp<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, params ReadOnlySpan<object?> @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult?

The population standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

Stdevp<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Computes the population standard deviation of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Stdevp<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

Returns

TResult?

The population standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

Stdevp<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params ReadOnlySpan<object?>)

Computes the population standard deviation of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Stdevp<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params ReadOnlySpan<object?> @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult?

The population standard deviation of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

SumAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params object[])

Computes the sum of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> SumAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult>

A task whose result is the sum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

SumAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, CancellationToken, params object[])

Computes the sum of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> SumAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult>

A task whose result is the sum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

Sum<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Computes the sum of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Sum<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

Returns

TResult

The sum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

Sum<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params ReadOnlySpan<object?>)

Computes the sum of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Sum<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult

The sum of the projected values, or null when the query has no non-null values.

Type Parameters

TEntity

The entity type being queried.

TResult

The type produced by the projection expression.

ToArrayAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Executes the query asynchronously and materializes the matching entities into an array, applying the same stitching as ToListAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[]).

public static Task<TEntity[]> ToArrayAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity[]>

A task whose result is an array containing the matching entities.

Type Parameters

TEntity

The entity type being queried.

ToArrayAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Executes the query asynchronously and materializes the matching entities into an array, applying the same stitching as ToListAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[]).

public static Task<TEntity[]> ToArrayAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TEntity[]>

A task whose result is an array containing the matching entities.

Type Parameters

TEntity

The entity type being queried.

ToArray<TEntity>(EntityBuilder<TEntity>)

Executes the query and materializes the matching entities into an array, binding no query parameters.

public static TEntity[] ToArray<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

TEntity[]

An array containing the matching entities.

Type Parameters

TEntity

The entity type being queried.

Remarks

The parameterless form is the expression-tree-usable terminal: the params ReadOnlySpan<object?> overload is a ref struct and an expanded params collection, so a query expression tree that ends in ToArray() cannot reference it (CS8640/CS9226). Both overloads execute the identical query; a zero-argument call simply takes this one.

ToArray<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Executes the query and materializes the matching entities into an array, applying the same stitching as ToList<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>).

public static TEntity[] ToArray<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TEntity[]

An array containing the matching entities.

Type Parameters

TEntity

The entity type being queried.

ToAsyncEnumerable<TEntity>(EntityBuilder<TEntity>, params object[])

Streams the matching entities as an asynchronous sequence without buffering the whole result set.

public static IAsyncEnumerable<TEntity> ToAsyncEnumerable<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

IAsyncEnumerable<TEntity>

An asynchronous sequence over the matching entities.

Type Parameters

TEntity

The entity type being queried.

ToAsyncEnumerable<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Streams the matching entities as an asynchronous sequence without buffering the whole result set.

public static IAsyncEnumerable<TEntity> ToAsyncEnumerable<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

IAsyncEnumerable<TEntity>

An asynchronous sequence over the matching entities.

Type Parameters

TEntity

The entity type being queried.

ToDictionaryAsync<TEntity, TKey>(EntityBuilder<TEntity>, Func<TEntity, TKey>, IEqualityComparer<TKey>?, CancellationToken, params object[])

Executes the query asynchronously and materializes the matching entities into a dictionary keyed by the projected values.

public static Task<Dictionary<TKey, TEntity>> ToDictionaryAsync<TEntity, TKey>(this EntityBuilder<TEntity> builder, Func<TEntity, TKey> keySelector, IEqualityComparer<TKey>? comparer, CancellationToken cancellationToken, params object[] @params) where TKey : notnull

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

keySelector Func<TEntity, TKey>

A function that derives the dictionary key from an entity.

comparer IEqualityComparer<TKey>

The equality comparer to use, or null to use the default comparer.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<Dictionary<TKey, TEntity>>

A task whose result is a dictionary of matching entities keyed by the selected keys.

Type Parameters

TEntity

The entity type being queried.

TKey

The type of the dictionary key.

ToDictionaryAsync<TEntity, TKey>(EntityBuilder<TEntity>, Func<TEntity, TKey>, params object[])

Executes the query asynchronously and materializes the matching entities into a dictionary keyed by the projected values.

public static Task<Dictionary<TKey, TEntity>> ToDictionaryAsync<TEntity, TKey>(this EntityBuilder<TEntity> builder, Func<TEntity, TKey> keySelector, params object[] @params) where TKey : notnull

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

keySelector Func<TEntity, TKey>

A function that derives the dictionary key from an entity.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<Dictionary<TKey, TEntity>>

A task whose result is a dictionary of matching entities keyed by the selected keys.

Type Parameters

TEntity

The entity type being queried.

TKey

The type of the dictionary key.

ToDictionaryAsync<TEntity, TKey>(EntityBuilder<TEntity>, Func<TEntity, TKey>, CancellationToken, params object[])

Executes the query asynchronously and materializes the matching entities into a dictionary keyed by the projected values.

public static Task<Dictionary<TKey, TEntity>> ToDictionaryAsync<TEntity, TKey>(this EntityBuilder<TEntity> builder, Func<TEntity, TKey> keySelector, CancellationToken cancellationToken, params object[] @params) where TKey : notnull

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

keySelector Func<TEntity, TKey>

A function that derives the dictionary key from an entity.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<Dictionary<TKey, TEntity>>

A task whose result is a dictionary of matching entities keyed by the selected keys.

Type Parameters

TEntity

The entity type being queried.

TKey

The type of the dictionary key.

ToDictionary<TEntity, TKey>(EntityBuilder<TEntity>, Func<TEntity, TKey>, IEqualityComparer<TKey>?, params ReadOnlySpan<object?>)

Executes the query and materializes the matching entities into a dictionary keyed by the projected values.

public static Dictionary<TKey, TEntity> ToDictionary<TEntity, TKey>(this EntityBuilder<TEntity> builder, Func<TEntity, TKey> keySelector, IEqualityComparer<TKey>? comparer, params ReadOnlySpan<object?> @params) where TKey : notnull

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

keySelector Func<TEntity, TKey>

A function that derives the dictionary key from an entity.

comparer IEqualityComparer<TKey>

The equality comparer to use, or null to use the default comparer.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

Dictionary<TKey, TEntity>

A dictionary of matching entities keyed by the selected keys.

Type Parameters

TEntity

The entity type being queried.

TKey

The type of the dictionary key.

ToDictionary<TEntity, TKey>(EntityBuilder<TEntity>, Func<TEntity, TKey>, params ReadOnlySpan<object?>)

Executes the query and materializes the matching entities into a dictionary keyed by the projected values.

public static Dictionary<TKey, TEntity> ToDictionary<TEntity, TKey>(this EntityBuilder<TEntity> builder, Func<TEntity, TKey> keySelector, params ReadOnlySpan<object?> @params) where TKey : notnull

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

keySelector Func<TEntity, TKey>

A function that derives the dictionary key from an entity.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

Dictionary<TKey, TEntity>

A dictionary of matching entities keyed by the selected keys.

Type Parameters

TEntity

The entity type being queried.

TKey

The type of the dictionary key.

ToEnumerable<TEntity>(EntityBuilder<TEntity>, params object[])

Executes the query and returns the matching entities as a synchronous sequence.

public static IEnumerable<TEntity> ToEnumerable<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

IEnumerable<TEntity>

A sequence over the matching entities.

Type Parameters

TEntity

The entity type being queried.

ToHashSetAsync<TEntity>(EntityBuilder<TEntity>, IEqualityComparer<TEntity>?, CancellationToken, params object[])

Executes the query asynchronously and materializes the distinct matching entities into a hash set.

public static Task<HashSet<TEntity>> ToHashSetAsync<TEntity>(this EntityBuilder<TEntity> builder, IEqualityComparer<TEntity>? comparer, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

comparer IEqualityComparer<TEntity>

The equality comparer to use, or null to use the default comparer.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<HashSet<TEntity>>

A task whose result is a hash set containing the distinct matching entities.

Type Parameters

TEntity

The entity type being queried.

ToHashSetAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Executes the query asynchronously and materializes the distinct matching entities into a hash set.

public static Task<HashSet<TEntity>> ToHashSetAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<HashSet<TEntity>>

A task whose result is a hash set containing the distinct matching entities.

Type Parameters

TEntity

The entity type being queried.

ToHashSetAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Executes the query asynchronously and materializes the distinct matching entities into a hash set.

public static Task<HashSet<TEntity>> ToHashSetAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<HashSet<TEntity>>

A task whose result is a hash set containing the distinct matching entities.

Type Parameters

TEntity

The entity type being queried.

ToHashSet<TEntity>(EntityBuilder<TEntity>, IEqualityComparer<TEntity>?, params ReadOnlySpan<object?>)

Executes the query and materializes the distinct matching entities into a hash set.

public static HashSet<TEntity> ToHashSet<TEntity>(this EntityBuilder<TEntity> builder, IEqualityComparer<TEntity>? comparer, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

comparer IEqualityComparer<TEntity>

The equality comparer to use, or null to use the default comparer.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

HashSet<TEntity>

A hash set containing the distinct matching entities.

Type Parameters

TEntity

The entity type being queried.

ToHashSet<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Executes the query and materializes the distinct matching entities into a hash set.

public static HashSet<TEntity> ToHashSet<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

HashSet<TEntity>

A hash set containing the distinct matching entities.

Type Parameters

TEntity

The entity type being queried.

ToListAsync<TEntity>(EntityBuilder<TEntity>, params object[])

Executes the query asynchronously and materializes the matching entities into a list.

public static Task<List<TEntity>> ToListAsync<TEntity>(this EntityBuilder<TEntity> builder, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<List<TEntity>>

A task whose result is a list containing the matching entities.

Type Parameters

TEntity

The entity type being queried.

ToListAsync<TEntity>(EntityBuilder<TEntity>, CancellationToken, params object[])

Executes the query asynchronously and materializes the matching entities into a list.

public static Task<List<TEntity>> ToListAsync<TEntity>(this EntityBuilder<TEntity> builder, CancellationToken cancellationToken, params object[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<List<TEntity>>

A task whose result is a list containing the matching entities.

Type Parameters

TEntity

The entity type being queried.

ToList<TEntity>(EntityBuilder<TEntity>)

Executes the query and materializes the matching entities into a list, binding no query parameters.

public static List<TEntity> ToList<TEntity>(this EntityBuilder<TEntity> builder)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

Returns

List<TEntity>

A list containing the matching entities.

Type Parameters

TEntity

The entity type being queried.

Remarks

The parameterless form is the expression-tree-usable terminal: the params ReadOnlySpan<object?> overload is a ref struct and an expanded params collection, so a query expression tree that ends in ToList() cannot reference it (CS8640/CS9226). Both overloads execute the identical query; a zero-argument call simply takes this one.

ToList<TEntity>(EntityBuilder<TEntity>, params ReadOnlySpan<object?>)

Executes the query and materializes the matching entities into a list. When the builder carries a JoinInto declaration or a single-query (EagerLoadMode.SingleQuery) eager load, one denormalized command is executed and its rows are stitched; otherwise the parent query is executed and any split LoadWith children are loaded afterwards.

public static List<TEntity> ToList<TEntity>(this EntityBuilder<TEntity> builder, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

List<TEntity>

A list containing the matching entities.

Type Parameters

TEntity

The entity type being queried.

VarAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, params object[])

Computes the sample variance of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> VarAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the sample variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

VarAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, CancellationToken, params object[])

Computes the sample variance of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> VarAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, CancellationToken cancellationToken, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the sample variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

VarAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params object[])

Computes the sample variance of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> VarAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the sample variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

VarAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, CancellationToken, params object[])

Computes the sample variance of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> VarAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, CancellationToken cancellationToken, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the sample variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

Var<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>)

Computes the sample variance of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Var<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

Returns

TResult?

The sample variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

Var<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, params ReadOnlySpan<object?>)

Computes the sample variance of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Var<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, params ReadOnlySpan<object?> @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult?

The sample variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

Var<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Computes the sample variance of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Var<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

Returns

TResult?

The sample variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

Var<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params ReadOnlySpan<object?>)

Computes the sample variance of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Var<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params ReadOnlySpan<object?> @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult?

The sample variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero or one contributing row is undefined. The non-nullable-selector and the TResult?-selector overloads are both supported.

VarpAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, params object[])

Computes the population variance of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> VarpAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the population variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

VarpAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, CancellationToken, params object[])

Computes the population variance of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> VarpAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, CancellationToken cancellationToken, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the population variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

VarpAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params object[])

Computes the population variance of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> VarpAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the population variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

VarpAsync<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, CancellationToken, params object[])

Computes the population variance of the projected values asynchronously. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static Task<TResult?> VarpAsync<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, CancellationToken cancellationToken, params object[] @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

cancellationToken CancellationToken

A token used to cancel the operation.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task<TResult?>

A task whose result is the population variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

Varp<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>)

Computes the population variance of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Varp<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

Returns

TResult?

The population variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

Varp<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult?>>, params ReadOnlySpan<object?>)

Computes the population variance of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Varp<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult?>> exp, params ReadOnlySpan<object?> @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult?>>

An expression selecting the values to aggregate; rows whose projection is null are ignored.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult?

The population variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

Varp<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>)

Computes the population variance of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Varp<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

Returns

TResult?

The population variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

Varp<TEntity, TResult>(EntityBuilder<TEntity>, Expression<Func<TEntity, TResult>>, params ReadOnlySpan<object?>)

Computes the population variance of the projected values. Rows whose projection is null are ignored, matching SQL aggregate semantics.

public static TResult? Varp<TEntity, TResult>(this EntityBuilder<TEntity> builder, Expression<Func<TEntity, TResult>> exp, params ReadOnlySpan<object?> @params) where TResult : struct

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

exp Expression<Func<TEntity, TResult>>

An expression selecting the values to aggregate.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Returns

TResult?

The population variance of the projected values, or null when it is undefined.

Type Parameters

TEntity

The entity type being queried.

TResult

The value type produced by the projection expression.

Remarks

The result is structurally nullable: zero contributing rows is undefined, while a single contributing row is zero. The non-nullable-selector and the TResult?-selector overloads are both supported.

WriteCsvAsync<TEntity>(EntityBuilder<TEntity>, Stream, CsvStreamOptions?, CancellationToken, params object?[])

Asynchronously writes the builder's Select result as CSV to destination.

public static Task WriteCsvAsync<TEntity>(this EntityBuilder<TEntity> builder, Stream destination, CsvStreamOptions? options = null, CancellationToken cancellationToken = default, params object?[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

destination Stream

The stream that receives the UTF-8 CSV; it stays open.

options CsvStreamOptions

The CSV dialect options, or null for the defaults.

cancellationToken CancellationToken

A token that cancels the write.

params object[]

The query parameters, in the order their placeholders appear.

Returns

Task

A task that completes when the CSV has been written.

Type Parameters

TEntity

The entity type being queried.

WriteCsv<TEntity>(EntityBuilder<TEntity>, Stream, CsvStreamOptions?, CancellationToken, params ReadOnlySpan<object?>)

Writes the builder's Select result as CSV to destination.

public static void WriteCsv<TEntity>(this EntityBuilder<TEntity> builder, Stream destination, CsvStreamOptions? options = null, CancellationToken cancellationToken = default, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

destination Stream

The stream that receives the UTF-8 CSV; it stays open.

options CsvStreamOptions

The CSV dialect options, or null for the defaults.

cancellationToken CancellationToken

A token that cancels the write.

params ReadOnlySpan<object>

The query parameters, in the order their placeholders appear.

Type Parameters

TEntity

The entity type being queried.

WriteJsonAsync<TEntity>(EntityBuilder<TEntity>, Stream, JsonStreamOptions, CancellationToken)

Asynchronously writes the query's projected rows directly to destination as JSON using options, without materializing a TEntity per row. The destination is owned by the caller and is never closed. Supported on database providers only.

public static Task WriteJsonAsync<TEntity>(this EntityBuilder<TEntity> builder, Stream destination, JsonStreamOptions options, CancellationToken cancellationToken = default)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

destination Stream

The caller-owned output stream; it is never closed. On a read, serialization or destination error, or on cancellation, the operation stops and the original exception propagates; already-written bytes are left in place (no rollback and no recovery tail), the destination stays open, and the writer never adds a Stream.Flush call.

options JsonStreamOptions

The JSON container and shaping options.

cancellationToken CancellationToken

A token observed while reading rows and writing to the stream.

Returns

Task

A task that completes when the whole document has been written.

Type Parameters

TEntity

The entity type being queried.

Exceptions

NotSupportedException

The query runs on the in-memory provider, the projection shape is not supported, or the option combination is invalid.

WriteJsonAsync<TEntity>(EntityBuilder<TEntity>, Stream, JsonStreamOptions, CancellationToken, params object?[])

Asynchronously writes the query's projected rows directly to stream as JSON using options and binding the positional SQL parameter values in params, without materializing a TEntity per row. The destination is owned by the caller and is never closed. Supported on database providers only.

public static Task WriteJsonAsync<TEntity>(this EntityBuilder<TEntity> builder, Stream stream, JsonStreamOptions options, CancellationToken cancellationToken, params object?[] @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

stream Stream

The caller-owned output stream; it is never closed. On a read, serialization or destination error, or on cancellation, the operation stops and the original exception propagates; already-written bytes are left in place (no rollback and no recovery tail), the destination stays open, and the writer never adds a Stream.Flush call.

options JsonStreamOptions

The JSON container and shaping options.

cancellationToken CancellationToken

A token observed while preparing, reading rows and writing to the stream.

params object[]

The positional SQL parameter values, in the order their placeholders appear. An empty set binds nothing; a null element binds DBNull.

Returns

Task

A task that completes when the whole document has been written.

Type Parameters

TEntity

The entity type being queried.

Exceptions

NotSupportedException

The query runs on the in-memory provider, the projection shape is not supported, or the option combination is invalid.

ArgumentNullException

builder, stream or options is null.

WriteJsonAsync<TEntity>(EntityBuilder<TEntity>, Stream, CancellationToken)

Asynchronously writes the query's projected rows directly to destination as a JSON array, without materializing a TEntity per row. The destination is owned by the caller and is never closed. Supported on database providers only.

public static Task WriteJsonAsync<TEntity>(this EntityBuilder<TEntity> builder, Stream destination, CancellationToken cancellationToken = default)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

destination Stream

The caller-owned output stream; it is never closed. On a read, serialization or destination error, or on cancellation, the operation stops and the original exception propagates; already-written bytes are left in place (no rollback and no recovery tail), the destination stays open, and the writer never adds a Stream.Flush call.

cancellationToken CancellationToken

A token observed while reading rows and writing to the stream.

Returns

Task

A task that completes when the whole document has been written.

Type Parameters

TEntity

The entity type being queried.

Exceptions

NotSupportedException

The query runs on the in-memory provider.

WriteJson<TEntity>(EntityBuilder<TEntity>, Stream)

Writes the query's projected rows directly to destination as a JSON array, without materializing a TEntity per row. The destination is owned by the caller and is never closed. Supported on database providers only.

public static void WriteJson<TEntity>(this EntityBuilder<TEntity> builder, Stream destination)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

destination Stream

The caller-owned output stream; it is never closed. On a read, serialization or destination error, or on cancellation, the operation stops and the original exception propagates; already-written bytes are left in place (no rollback and no recovery tail), the destination stays open, and the writer never adds a Stream.Flush call.

Type Parameters

TEntity

The entity type being queried.

Exceptions

NotSupportedException

The query runs on the in-memory provider.

WriteJson<TEntity>(EntityBuilder<TEntity>, Stream, JsonStreamOptions)

Writes the query's projected rows directly to destination as JSON using options, without materializing a TEntity per row. The destination is owned by the caller and is never closed. Supported on database providers only.

public static void WriteJson<TEntity>(this EntityBuilder<TEntity> builder, Stream destination, JsonStreamOptions options)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

destination Stream

The caller-owned output stream; it is never closed. On a read, serialization or destination error, or on cancellation, the operation stops and the original exception propagates; already-written bytes are left in place (no rollback and no recovery tail), the destination stays open, and the writer never adds a Stream.Flush call.

options JsonStreamOptions

The JSON container and shaping options.

Type Parameters

TEntity

The entity type being queried.

Exceptions

NotSupportedException

The query runs on the in-memory provider, the projection shape is not supported, or the option combination is invalid.

WriteJson<TEntity>(EntityBuilder<TEntity>, Stream, JsonStreamOptions, CancellationToken, params ReadOnlySpan<object?>)

Writes the query's projected rows directly to stream as JSON using options and binding the positional SQL parameter values in params, without materializing a TEntity per row. The destination is owned by the caller and is never closed. Supported on database providers only.

public static void WriteJson<TEntity>(this EntityBuilder<TEntity> builder, Stream stream, JsonStreamOptions options, CancellationToken cancellationToken, params ReadOnlySpan<object?> @params)

Parameters

builder EntityBuilder<TEntity>

The query builder being extended.

stream Stream

The caller-owned output stream; it is never closed. On a read, serialization or destination error, or on cancellation, the operation stops and the original exception propagates; already-written bytes are left in place (no rollback and no recovery tail), the destination stays open, and the writer never adds a Stream.Flush call.

options JsonStreamOptions

The JSON container and shaping options.

cancellationToken CancellationToken

A token observed while preparing, reading rows and writing to the stream.

params ReadOnlySpan<object>

The positional SQL parameter values, in the order their placeholders appear. An empty set binds nothing; a null element binds DBNull.

Type Parameters

TEntity

The entity type being queried.

Exceptions

NotSupportedException

The query runs on the in-memory provider, the projection shape is not supported, or the option combination is invalid.

ArgumentNullException

builder, stream or options is null.