Path: redb/redb.Core/Providers/ILazyPropsLoader.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Core/Providers/ILazyPropsLoader.cs
----
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using redb.Core.Models.Entities;
namespace redb.Core.Providers
{
///
/// Interface for lazy loading of RedbObject Props.
///
public interface ILazyPropsLoader
{
///
/// Synchronous Props loading (for Properties getter).
///
/// Object ID
/// Scheme ID
/// Object Props, or null when the target is gone (moved to the trash) - V4 (L.3, LAZY �4.8)
TProps? LoadProps(long objectId, long schemeId) where TProps : class, new();
///
/// The database (cache domain) this loader reads. A loader bound to one scope names its database: the reference
/// stubs it materializes then carry the one scope-free loader of that database, which loads on the live scope of
/// whoever reads them (owner decision 2026-09-15). Null for a loader bound to no database.
///
string? CacheDomain => null;
///
/// The context (one scope, one connection) this loader is bound to. The stubs and list items it materializes keep
/// the service of that scope as their origin: when no redb scope is current for the reader, they load on the origin
/// while it lives and the instance is not shared (owner decision 2026-09-15). Null for a loader bound to no scope.
///
Data.IRedbContext? ScopeContext => null;
///
/// Asynchronous Props loading (for explicit preload LoadPropsAsync).
///
/// Object ID
/// Scheme ID
/// Object Props, or null when the target is gone (moved to the trash) - V4 (L.3, LAZY �4.8)
/// Cancels the operation (OCE only; a rollback in flight always completes).
Task LoadPropsAsync(long objectId, long schemeId,
CancellationToken cancellationToken = default) where TProps : class, new();
///
/// BULK Props loading for multiple objects with caching and parallelism.
///
/// List of objects to load Props for
/// Cancels the operation (OCE only; a rollback in flight always completes).
Task LoadPropsForManyAsync(List> objects,
CancellationToken cancellationToken = default) where TProps : class, new();
///
/// OPTIMIZED Props loading with structure_ids filter.
/// Loads only specified fields from _values (for Select projections).
///
/// List of objects to load Props for
/// HashSet of structure_ids for _values filtering (null = all)
/// Cancels the operation (OCE only; a rollback in flight always completes).
Task LoadPropsForManyAsync(
List> objects,
HashSet? projectedStructureIds,
CancellationToken cancellationToken = default) where TProps : class, new();
///
/// BULK Props loading with custom depth for nested RedbObject.
///
/// List of objects to load Props for
/// Maximum depth for nested RedbObject loading (null = use config default)
/// Cancels the operation (OCE only; a rollback in flight always completes).
Task LoadPropsForManyAsync(
List> objects,
int? propsDepth,
CancellationToken cancellationToken = default) where TProps : class, new();
///
/// OPTIMIZED Props loading with structure_ids filter and custom depth.
///
/// List of objects to load Props for
/// HashSet of structure_ids for _values filtering (null = all)
/// Maximum depth for nested RedbObject loading (null = use config default)
/// Cancels the operation (OCE only; a rollback in flight always completes).
Task LoadPropsForManyAsync(
List> objects,
HashSet? projectedStructureIds,
int? propsDepth,
CancellationToken cancellationToken = default) where TProps : class, new();
}
}