Table of Contents

Class ProjectedQuery<TSource, TResult>

Namespace
CL.MySQL2.Services
Assembly
CL.MySQL2.dll

A query pipeline whose output rows are TResult, produced by projecting from an underlying entity type TSource. Built by QueryBuilder<T>.Select<TResult> (and, once task #4 lands, by GroupedQuery<TKey, TSource>.Select<TResult>).

public sealed class ProjectedQuery<TSource, TResult> where TSource : class, new()

Type Parameters

TSource
TResult
Inheritance
ProjectedQuery<TSource, TResult>
Inherited Members

Methods

FirstOrDefaultAsync(CancellationToken)

public Task<Result<TResult?>> FirstOrDefaultAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<Result<TResult>>

SmartCache(string)

Opt this projected query into a named SmartCachePool. See QueryBuilder.SmartCache for details.

public ProjectedQuery<TSource, TResult> SmartCache(string poolName)

Parameters

poolName string

Returns

ProjectedQuery<TSource, TResult>

ToListAsync(CancellationToken)

public Task<Result<List<TResult>>> ToListAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<Result<List<TResult>>>

WithCache(TimeSpan)

Enable result caching for this projected query. TTL and time-quantize behaviour come from CacheConfiguration globally; per-call TTL wins here.

public ProjectedQuery<TSource, TResult> WithCache(TimeSpan ttl)

Parameters

ttl TimeSpan

Returns

ProjectedQuery<TSource, TResult>