Class ProjectedQuery<TSource, TResult>
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
TSourceTResult
- Inheritance
-
ProjectedQuery<TSource, TResult>
- Inherited Members
Methods
FirstOrDefaultAsync(CancellationToken)
public Task<Result<TResult?>> FirstOrDefaultAsync(CancellationToken ct = default)
Parameters
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
poolNamestring
Returns
- ProjectedQuery<TSource, TResult>
ToListAsync(CancellationToken)
public Task<Result<List<TResult>>> ToListAsync(CancellationToken ct = default)
Parameters
Returns
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
ttlTimeSpan
Returns
- ProjectedQuery<TSource, TResult>