Class RedbProjectedQueryable<TProps, TResult>
Implementation of LINQ query projections in REDB with filtering and sorting support
OPTIMIZED: Uses ProjectionFieldExtractor to load only required fields
public class RedbProjectedQueryable<TProps, TResult> : IRedbProjectedQueryable<TResult> where TProps : class, new()
Inheritance
Implements
Properties
ProjectedFieldPaths
Text field paths for SQL function search_objects_with_projection_by_paths
public List<string>? ProjectedFieldPaths { get; }
ProjectedStructureIds
Extracted structure_ids for optimization (for provider access)
public HashSet<long>? ProjectedStructureIds { get; }
Projection
Projection expression (for provider access)
public Expression<Func<RedbObject<TProps>, TResult>> Projection { get; }
Methods
CountAsync(CancellationToken)
Count results.
public Task<int> CountAsync(CancellationToken cancellationToken = default)
FirstOrDefaultAsync(CancellationToken)
Get first result or default value.
public Task<TResult?> FirstOrDefaultAsync(CancellationToken cancellationToken = default)
GetProjectionInfoAsync()
Get projection info: SQL function and structure_ids that will be loaded.
public Task<string> GetProjectionInfoAsync()
GetProjectionInfoAsync(CancellationToken)
Get projection info: SQL function and structure_ids that will be loaded.
public Task<string> GetProjectionInfoAsync(CancellationToken cancellationToken = default)
OrderBy<TKey>(Expression<Func<TResult, TKey>>)
Sort projected results.
public IRedbProjectedQueryable<TResult> OrderBy<TKey>(Expression<Func<TResult, TKey>> keySelector)
OrderByDescending<TKey>(Expression<Func<TResult, TKey>>)
Sort projected results descending.
public IRedbProjectedQueryable<TResult> OrderByDescending<TKey>(Expression<Func<TResult, TKey>> keySelector)
ThenBy<TKey>(Expression<Func<TResult, TKey>>)
Adds a key to the ordering started by OrderBy or OrderByDescending.
public IRedbProjectedQueryable<TResult> ThenBy<TKey>(Expression<Func<TResult, TKey>> keySelector)
ThenByDescending<TKey>(Expression<Func<TResult, TKey>>)
Adds a descending key to the ordering started by OrderBy or OrderByDescending.
public IRedbProjectedQueryable<TResult> ThenByDescending<TKey>(Expression<Func<TResult, TKey>> keySelector)
ToListAsync(CancellationToken)
Execute query and get list of results.
public Task<List<TResult>> ToListAsync(CancellationToken cancellationToken = default)
Where(Expression<Func<TResult, bool>>)
Additional filtering of projected results.
public IRedbProjectedQueryable<TResult> Where(Expression<Func<TResult, bool>> predicate)
Constructors
RedbProjectedQueryable(IRedbQueryable<TProps>, Expression<Func<RedbObject<TProps>, TResult>>, IRedbQueryProvider, long)
Constructor with provider for optimized loading