Table of Contents

Class GraphQlQueryableAsyncExtensions

Namespace
BpNexT.NET.GraphQL.Queryable
Assembly
BpNexT.NET.GraphQL.dll

Async terminal operators for GraphQL-backed queries. Each operator builds the same expression tree its synchronous Queryable counterpart would produce and executes it through the provider's async pipeline, so query translation (rowRead/rowsRead/conRead selection, filter splitting) is identical to the sync path.

public static class GraphQlQueryableAsyncExtensions
Inheritance
object
GraphQlQueryableAsyncExtensions

Methods

AllAsync<T>(IQueryable<T>, Expression<Func<T, bool>>, CancellationToken)

Asynchronously determines whether all elements match the predicate.

public static Task<bool> AllAsync<T>(this IQueryable<T> source, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
predicate Expression<Func<T, bool>>
cancellationToken CancellationToken

Returns

Task<bool>

Type Parameters

T

AnyAsync<T>(IQueryable<T>, Expression<Func<T, bool>>, CancellationToken)

Asynchronously determines whether any element matches the predicate.

public static Task<bool> AnyAsync<T>(this IQueryable<T> source, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
predicate Expression<Func<T, bool>>
cancellationToken CancellationToken

Returns

Task<bool>

Type Parameters

T

AnyAsync<T>(IQueryable<T>, CancellationToken)

Asynchronously determines whether the query yields any elements.

public static Task<bool> AnyAsync<T>(this IQueryable<T> source, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
cancellationToken CancellationToken

Returns

Task<bool>

Type Parameters

T

CountAsync<T>(IQueryable<T>, Expression<Func<T, bool>>, CancellationToken)

Asynchronously counts the elements of the query matching the predicate.

public static Task<int> CountAsync<T>(this IQueryable<T> source, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
predicate Expression<Func<T, bool>>
cancellationToken CancellationToken

Returns

Task<int>

Type Parameters

T

CountAsync<T>(IQueryable<T>, CancellationToken)

Asynchronously counts the elements of the query.

public static Task<int> CountAsync<T>(this IQueryable<T> source, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
cancellationToken CancellationToken

Returns

Task<int>

Type Parameters

T

FirstAsync<T>(IQueryable<T>, Expression<Func<T, bool>>, CancellationToken)

Asynchronously returns the first element of the query matching the predicate.

public static Task<T> FirstAsync<T>(this IQueryable<T> source, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
predicate Expression<Func<T, bool>>
cancellationToken CancellationToken

Returns

Task<T>

Type Parameters

T

FirstAsync<T>(IQueryable<T>, CancellationToken)

Asynchronously returns the first element of the query.

public static Task<T> FirstAsync<T>(this IQueryable<T> source, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
cancellationToken CancellationToken

Returns

Task<T>

Type Parameters

T

FirstOrDefaultAsync<T>(IQueryable<T>, Expression<Func<T, bool>>, CancellationToken)

Asynchronously returns the first element matching the predicate, or default when none match.

public static Task<T?> FirstOrDefaultAsync<T>(this IQueryable<T> source, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
predicate Expression<Func<T, bool>>
cancellationToken CancellationToken

Returns

Task<T>

Type Parameters

T

FirstOrDefaultAsync<T>(IQueryable<T>, CancellationToken)

Asynchronously returns the first element of the query, or default when empty.

public static Task<T?> FirstOrDefaultAsync<T>(this IQueryable<T> source, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
cancellationToken CancellationToken

Returns

Task<T>

Type Parameters

T

SingleAsync<T>(IQueryable<T>, Expression<Func<T, bool>>, CancellationToken)

Asynchronously returns the only element matching the predicate; throws when zero or multiple rows match.

public static Task<T> SingleAsync<T>(this IQueryable<T> source, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
predicate Expression<Func<T, bool>>
cancellationToken CancellationToken

Returns

Task<T>

Type Parameters

T

SingleAsync<T>(IQueryable<T>, CancellationToken)

Asynchronously returns the only element of the query; throws when the query yields zero or multiple rows.

public static Task<T> SingleAsync<T>(this IQueryable<T> source, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
cancellationToken CancellationToken

Returns

Task<T>

Type Parameters

T

SingleOrDefaultAsync<T>(IQueryable<T>, Expression<Func<T, bool>>, CancellationToken)

Asynchronously returns the only element matching the predicate or default; throws on multiple matches.

public static Task<T?> SingleOrDefaultAsync<T>(this IQueryable<T> source, Expression<Func<T, bool>> predicate, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
predicate Expression<Func<T, bool>>
cancellationToken CancellationToken

Returns

Task<T>

Type Parameters

T

SingleOrDefaultAsync<T>(IQueryable<T>, CancellationToken)

Asynchronously returns the only element of the query or default when empty; throws on multiple rows.

public static Task<T?> SingleOrDefaultAsync<T>(this IQueryable<T> source, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
cancellationToken CancellationToken

Returns

Task<T>

Type Parameters

T

ToArrayAsync<T>(IQueryable<T>, CancellationToken)

Asynchronously materializes the query into an array.

public static Task<T[]> ToArrayAsync<T>(this IQueryable<T> source, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
cancellationToken CancellationToken

Returns

Task<T[]>

Type Parameters

T

ToListAsync<T>(IQueryable<T>, CancellationToken)

Asynchronously materializes the query into a List<T>.

public static Task<List<T>> ToListAsync<T>(this IQueryable<T> source, CancellationToken cancellationToken = default)

Parameters

source IQueryable<T>
cancellationToken CancellationToken

Returns

Task<List<T>>

Type Parameters

T