Class RedbServiceBase
Base abstract class for RedbService implementations.
Contains all common logic for delegating to providers.
Provider-specific implementations (Postgres, MSSQL) inherit from this class.
public abstract class RedbServiceBase : IRedbService, ISchemeSyncProvider, IObjectStorageProvider, ITreeProvider, IPermissionProvider, IQueryableProvider, IValidationProvider, IRedbScopeSource
Inheritance
Implements
Derived
Properties
CanCreateScope
Whether can open a scope: the service came from a container with a scope factory.
public bool CanCreateScope { get; }
ContextNotRegisteredError
Error message when IRedbContext is not registered.
protected abstract string ContextNotRegisteredError { get; }
DatabaseTypeName
Database provider name (e.g., "PostgreSQL", "MSSql").
protected abstract string DatabaseTypeName { get; }
dbVersion
public string dbVersion { get; }
GetDatabaseSizeSql
SQL query to get database size in bytes.
protected abstract string GetDatabaseSizeSql { get; }
LazyPropsLoader
This service's own lazy Props loader, bound to its context. Reference stubs never carry it: they carry the
protected ILazyPropsLoader LazyPropsLoader { get; set; }
Logger
The logger of this service; null when the host registered none.
protected ILogger? Logger { get; }
Maintenance
Storage maintenance: planner statistics (AnalyzeAsync after bulk writes) and
public IMaintenanceProvider Maintenance { get; }
PropsCache
Domain-bound props/object cache for this provider.
public GlobalPropsCache PropsCache { get; }
SchemaProblems
Problems of the database schema that do not stop the service but need a person, as found by the last
public IReadOnlyList<RedbSchemaProblem> SchemaProblems { get; }
SecurityContext
Security context for user and permission management.
public IRedbSecurityContext SecurityContext { get; }
SqlDialect
SQL dialect for database-specific queries.
protected abstract ISqlDialect SqlDialect { get; }
Methods
AcquireSchemaLockAsync(CancellationToken)
Takes the schema lock, waiting while another process holds it: one attempt every half second, a line in the log
protected Task<IAsyncDisposable> AcquireSchemaLockAsync(CancellationToken cancellationToken = default)
AddNewObjectsAsync<TProps>(IEnumerable<IRedbObject<TProps>>, CancellationToken)
BULK INSERT: Create many new objects in one operation (does NOT check permissions).
public Task<List<long>> AddNewObjectsAsync<TProps>(IEnumerable<IRedbObject<TProps>> objects, CancellationToken cancellationToken = default) where TProps : class, new()
AddNewObjectsAsync<TProps>(IEnumerable<IRedbObject<TProps>>, IRedbUser, CancellationToken)
BULK INSERT with explicit user: Create many new objects (does NOT check permissions).
public Task<List<long>> AddNewObjectsAsync<TProps>(IEnumerable<IRedbObject<TProps>> objects, IRedbUser user, CancellationToken cancellationToken = default) where TProps : class, new()
AddNewObjectsAsync<TProps>(IEnumerable<IRedbObject<TProps>>, IRedbUser)
BULK INSERT with explicit user: Create many new objects (does NOT check permissions).
public Task<List<long>> AddNewObjectsAsync<TProps>(IEnumerable<IRedbObject<TProps>> objects, IRedbUser user) where TProps : class, new()
AddNewObjectsAsync<TProps>(IEnumerable<IRedbObject<TProps>>)
BULK INSERT: Create many new objects in one operation (does NOT check permissions).
public Task<List<long>> AddNewObjectsAsync<TProps>(IEnumerable<IRedbObject<TProps>> objects) where TProps : class, new()
AnalyzeSchemaChangesAsync<TProps>(IRedbScheme, CancellationToken)
Check schema change compatibility.
public Task<SchemaChangeReport> AnalyzeSchemaChangesAsync<TProps>(IRedbScheme scheme, CancellationToken cancellationToken = default) where TProps : class
AnalyzeSchemaChangesAsync<TProps>(IRedbScheme)
Check schema change compatibility.
public Task<SchemaChangeReport> AnalyzeSchemaChangesAsync<TProps>(IRedbScheme scheme) where TProps : class
BeginAccess()
Makes this service the scope lazy loads run on, for the returned block (owner decision 2026-09-15): a data
public IDisposable BeginAccess()
CanUserDeleteObject(IRedbObject, CancellationToken)
Check if current user can delete object.
public Task<bool> CanUserDeleteObject(IRedbObject obj, CancellationToken cancellationToken = default)
CanUserDeleteObject(IRedbObject, IRedbUser, CancellationToken)
Check if user can delete object.
public Task<bool> CanUserDeleteObject(IRedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
CanUserDeleteObject(IRedbObject, IRedbUser)
Check if user can delete object.
public Task<bool> CanUserDeleteObject(IRedbObject obj, IRedbUser user)
CanUserDeleteObject(IRedbObject)
Check if current user can delete object.
public Task<bool> CanUserDeleteObject(IRedbObject obj)
CanUserDeleteObject(long, long, CancellationToken)
public Task<bool> CanUserDeleteObject(long objectId, long userId, CancellationToken cancellationToken = default)
CanUserDeleteObject(long, long)
public Task<bool> CanUserDeleteObject(long objectId, long userId)
CanUserDeleteObject(RedbObject, CancellationToken)
Check if current user can delete object.
public Task<bool> CanUserDeleteObject(RedbObject obj, CancellationToken cancellationToken = default)
CanUserDeleteObject(RedbObject, IRedbUser, CancellationToken)
Check if user can delete object.
public Task<bool> CanUserDeleteObject(RedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
CanUserDeleteObject(RedbObject, IRedbUser)
Check if user can delete object.
public Task<bool> CanUserDeleteObject(RedbObject obj, IRedbUser user)
CanUserDeleteObject(RedbObject)
Check if current user can delete object.
public Task<bool> CanUserDeleteObject(RedbObject obj)
CanUserEditObject(IRedbObject, CancellationToken)
Check if current user can edit object.
public Task<bool> CanUserEditObject(IRedbObject obj, CancellationToken cancellationToken = default)
CanUserEditObject(IRedbObject, IRedbUser, CancellationToken)
Check if user can edit object.
public Task<bool> CanUserEditObject(IRedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
CanUserEditObject(IRedbObject, IRedbUser)
Check if user can edit object.
public Task<bool> CanUserEditObject(IRedbObject obj, IRedbUser user)
CanUserEditObject(IRedbObject)
Check if current user can edit object.
public Task<bool> CanUserEditObject(IRedbObject obj)
CanUserEditObject(long, long, CancellationToken)
public Task<bool> CanUserEditObject(long objectId, long userId, CancellationToken cancellationToken = default)
CanUserEditObject(long, long)
public Task<bool> CanUserEditObject(long objectId, long userId)
CanUserEditObject(RedbObject, CancellationToken)
Check if current user can edit object.
public Task<bool> CanUserEditObject(RedbObject obj, CancellationToken cancellationToken = default)
CanUserEditObject(RedbObject, IRedbUser, CancellationToken)
Check if user can edit object.
public Task<bool> CanUserEditObject(RedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
CanUserEditObject(RedbObject, IRedbUser)
Check if user can edit object.
public Task<bool> CanUserEditObject(RedbObject obj, IRedbUser user)
CanUserEditObject(RedbObject)
Check if current user can edit object.
public Task<bool> CanUserEditObject(RedbObject obj)
CanUserInsertScheme(IRedbScheme, CancellationToken)
Check if current user can create objects in scheme.
public Task<bool> CanUserInsertScheme(IRedbScheme scheme, CancellationToken cancellationToken = default)
CanUserInsertScheme(IRedbScheme, IRedbUser, CancellationToken)
Check if user can create objects in scheme.
public Task<bool> CanUserInsertScheme(IRedbScheme scheme, IRedbUser user, CancellationToken cancellationToken = default)
CanUserInsertScheme(IRedbScheme, IRedbUser)
Check if user can create objects in scheme.
public Task<bool> CanUserInsertScheme(IRedbScheme scheme, IRedbUser user)
CanUserInsertScheme(IRedbScheme)
Check if current user can create objects in scheme.
public Task<bool> CanUserInsertScheme(IRedbScheme scheme)
CanUserInsertScheme(long, long, CancellationToken)
public Task<bool> CanUserInsertScheme(long schemeId, long userId, CancellationToken cancellationToken = default)
CanUserInsertScheme(long, long)
public Task<bool> CanUserInsertScheme(long schemeId, long userId)
CanUserInsertScheme(RedbObject, IRedbUser, CancellationToken)
Check if user can create objects in object's scheme.
public Task<bool> CanUserInsertScheme(RedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
CanUserInsertScheme(RedbObject, IRedbUser)
Check if user can create objects in object's scheme.
public Task<bool> CanUserInsertScheme(RedbObject obj, IRedbUser user)
CanUserSelectObject(IRedbObject, CancellationToken)
Check if current user can read object.
public Task<bool> CanUserSelectObject(IRedbObject obj, CancellationToken cancellationToken = default)
CanUserSelectObject(IRedbObject, IRedbUser, CancellationToken)
Check if user can read object.
public Task<bool> CanUserSelectObject(IRedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
CanUserSelectObject(IRedbObject, IRedbUser)
Check if user can read object.
public Task<bool> CanUserSelectObject(IRedbObject obj, IRedbUser user)
CanUserSelectObject(IRedbObject)
Check if current user can read object.
public Task<bool> CanUserSelectObject(IRedbObject obj)
CanUserSelectObject(long, long, CancellationToken)
public Task<bool> CanUserSelectObject(long objectId, long userId, CancellationToken cancellationToken = default)
CanUserSelectObject(long, long)
public Task<bool> CanUserSelectObject(long objectId, long userId)
CanUserSelectObject(RedbObject, CancellationToken)
Check if current user can read object.
public Task<bool> CanUserSelectObject(RedbObject obj, CancellationToken cancellationToken = default)
CanUserSelectObject(RedbObject, IRedbUser, CancellationToken)
Check if user can read object.
public Task<bool> CanUserSelectObject(RedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
CanUserSelectObject(RedbObject, IRedbUser)
Check if user can read object.
public Task<bool> CanUserSelectObject(RedbObject obj, IRedbUser user)
CanUserSelectObject(RedbObject)
Check if current user can read object.
public Task<bool> CanUserSelectObject(RedbObject obj)
CheckSchemaAsync(CancellationToken)
Looks for schema problems in the database again (read only, no schema lock) and returns the current list,
public Task<IReadOnlyList<RedbSchemaProblem>> CheckSchemaAsync(CancellationToken cancellationToken = default)
CreateChildAsync<TProps>(TreeRedbObject<TProps>, IRedbObject, CancellationToken)
Create child object (uses _securityContext and config.DefaultCheckPermissionsOnSave).
public Task<long> CreateChildAsync<TProps>(TreeRedbObject<TProps> obj, IRedbObject parentObj, CancellationToken cancellationToken = default) where TProps : class, new()
CreateChildAsync<TProps>(TreeRedbObject<TProps>, IRedbObject, IRedbUser, CancellationToken)
Create child object with explicit user (uses config.DefaultCheckPermissionsOnSave).
public Task<long> CreateChildAsync<TProps>(TreeRedbObject<TProps> obj, IRedbObject parentObj, IRedbUser user, CancellationToken cancellationToken = default) where TProps : class, new()
CreateChildAsync<TProps>(TreeRedbObject<TProps>, IRedbObject, IRedbUser)
Create child object with explicit user (uses config.DefaultCheckPermissionsOnSave).
public Task<long> CreateChildAsync<TProps>(TreeRedbObject<TProps> obj, IRedbObject parentObj, IRedbUser user) where TProps : class, new()
CreateChildAsync<TProps>(TreeRedbObject<TProps>, IRedbObject)
Create child object (uses _securityContext and config.DefaultCheckPermissionsOnSave).
public Task<long> CreateChildAsync<TProps>(TreeRedbObject<TProps> obj, IRedbObject parentObj) where TProps : class, new()
CreateLazyPropsLoader(IRedbContext, ISchemeSyncProvider, IRedbObjectSerializer, RedbServiceConfiguration, string, IListProvider, ILogger?)
Create lazy props loader.
protected abstract ILazyPropsLoader CreateLazyPropsLoader(IRedbContext context, ISchemeSyncProvider schemeSync, IRedbObjectSerializer serializer, RedbServiceConfiguration config, string cacheDomain, IListProvider listProvider, ILogger? logger)
CreateListProvider(IRedbContext, RedbServiceConfiguration, ISchemeSyncProvider, ILogger?)
Create list provider.
protected abstract IListProvider CreateListProvider(IRedbContext context, RedbServiceConfiguration config, ISchemeSyncProvider schemeSync, ILogger? logger)
CreateMaintenanceProvider(IRedbContext, int, ILogger?)
Factory for the maintenance provider (planner statistics, index health). Lazy: most
protected abstract IMaintenanceProvider CreateMaintenanceProvider(IRedbContext context, int analysisLimit, ILogger? logger)
CreateObjectStorageProvider(IRedbContext, IRedbObjectSerializer, IPermissionProvider, IRedbSecurityContext, ISchemeSyncProvider, RedbServiceConfiguration, IListProvider, ILogger?, RedbSaveInterceptorPipeline?)
Create object storage provider.
protected abstract IObjectStorageProvider CreateObjectStorageProvider(IRedbContext context, IRedbObjectSerializer serializer, IPermissionProvider permissionProvider, IRedbSecurityContext securityContext, ISchemeSyncProvider schemeSync, RedbServiceConfiguration config, IListProvider listProvider, ILogger? logger, RedbSaveInterceptorPipeline? saveInterceptors)
CreateObjectStorageProvider(IRedbContext, IRedbObjectSerializer, IPermissionProvider, IRedbSecurityContext, ISchemeSyncProvider, RedbServiceConfiguration, IListProvider, ILogger?)
Create object storage provider.
protected abstract IObjectStorageProvider CreateObjectStorageProvider(IRedbContext context, IRedbObjectSerializer serializer, IPermissionProvider permissionProvider, IRedbSecurityContext securityContext, ISchemeSyncProvider schemeSync, RedbServiceConfiguration config, IListProvider listProvider, ILogger? logger)
CreatePermissionAsync(PermissionRequest, IRedbUser?, CancellationToken)
Create new permission.
public Task<IRedbPermission> CreatePermissionAsync(PermissionRequest request, IRedbUser? currentUser = null, CancellationToken cancellationToken = default)
CreatePermissionAsync(PermissionRequest, IRedbUser?)
Create new permission.
public Task<IRedbPermission> CreatePermissionAsync(PermissionRequest request, IRedbUser? currentUser = null)
CreatePermissionProvider(IRedbContext, IRedbSecurityContext, ILogger?)
Create permission provider.
protected abstract IPermissionProvider CreatePermissionProvider(IRedbContext context, IRedbSecurityContext securityContext, ILogger? logger)
CreateQueryableProvider(IRedbContext, IRedbObjectSerializer, ISchemeSyncProvider, IRedbSecurityContext, ILazyPropsLoader, RedbServiceConfiguration, string, ILogger?)
Create queryable provider.
protected abstract IQueryableProvider CreateQueryableProvider(IRedbContext context, IRedbObjectSerializer serializer, ISchemeSyncProvider schemeSync, IRedbSecurityContext securityContext, ILazyPropsLoader lazyPropsLoader, RedbServiceConfiguration config, string cacheDomain, ILogger? logger)
CreateRoleProvider(IRedbContext, IRedbSecurityContext, ILogger?)
Create role provider.
protected abstract IRoleProvider CreateRoleProvider(IRedbContext context, IRedbSecurityContext securityContext, ILogger? logger)
CreateSchemeSyncProvider(IRedbContext, RedbServiceConfiguration, string, ILogger?)
Create scheme sync provider.
protected abstract ISchemeSyncProvider CreateSchemeSyncProvider(IRedbContext context, RedbServiceConfiguration config, string cacheDomain, ILogger? logger)
CreateScope()
Opens a scope of the service's container and returns its service of the same database; the holder owns the
public RedbScope CreateScope()
CreateTreeProvider(IRedbContext, IObjectStorageProvider, IPermissionProvider, IRedbObjectSerializer, IRedbSecurityContext, ISchemeSyncProvider, RedbServiceConfiguration, ILogger?)
Create tree provider.
protected abstract ITreeProvider CreateTreeProvider(IRedbContext context, IObjectStorageProvider objectStorage, IPermissionProvider permissionProvider, IRedbObjectSerializer serializer, IRedbSecurityContext securityContext, ISchemeSyncProvider schemeSync, RedbServiceConfiguration config, ILogger? logger)
CreateUserProvider(IRedbContext, IRedbSecurityContext, ILogger?)
Create user provider.
protected abstract IUserProvider CreateUserProvider(IRedbContext context, IRedbSecurityContext securityContext, ILogger? logger)
CreateValidationProvider(IRedbContext, ILogger?)
Create validation provider.
protected abstract IValidationProvider CreateValidationProvider(IRedbContext context, ILogger? logger)
DeleteAsync(IEnumerable<IRedbObject>, CancellationToken)
Bulk delete objects by interface (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteAsync(IEnumerable<IRedbObject> objects, CancellationToken cancellationToken = default)
DeleteAsync(IEnumerable<IRedbObject>, IRedbUser, CancellationToken)
Bulk delete objects by interface with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteAsync(IEnumerable<IRedbObject> objects, IRedbUser user, CancellationToken cancellationToken = default)
DeleteAsync(IEnumerable<IRedbObject>, IRedbUser)
Bulk delete objects by interface with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteAsync(IEnumerable<IRedbObject> objects, IRedbUser user)
DeleteAsync(IEnumerable<IRedbObject>)
Bulk delete objects by interface (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteAsync(IEnumerable<IRedbObject> objects)
DeleteAsync(IEnumerable<long>, CancellationToken)
Bulk delete objects by ID (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteAsync(IEnumerable<long> objectIds, CancellationToken cancellationToken = default)
DeleteAsync(IEnumerable<long>, IRedbUser, CancellationToken)
Bulk delete objects by ID with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteAsync(IEnumerable<long> objectIds, IRedbUser user, CancellationToken cancellationToken = default)
DeleteAsync(IEnumerable<long>, IRedbUser)
Bulk delete objects by ID with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteAsync(IEnumerable<long> objectIds, IRedbUser user)
DeleteAsync(IEnumerable<long>)
Bulk delete objects by ID (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteAsync(IEnumerable<long> objectIds)
DeleteAsync(IRedbObject, CancellationToken)
Delete object (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<bool> DeleteAsync(IRedbObject obj, CancellationToken cancellationToken = default)
DeleteAsync(IRedbObject, IRedbUser, CancellationToken)
Delete object with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<bool> DeleteAsync(IRedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
DeleteAsync(IRedbObject, IRedbUser)
Delete object with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<bool> DeleteAsync(IRedbObject obj, IRedbUser user)
DeleteAsync(IRedbObject)
Delete object (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<bool> DeleteAsync(IRedbObject obj)
DeleteAsync(long, CancellationToken)
Delete object by ID (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<bool> DeleteAsync(long objectId, CancellationToken cancellationToken = default)
DeleteAsync(long, IRedbUser, CancellationToken)
Delete object by ID with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<bool> DeleteAsync(long objectId, IRedbUser user, CancellationToken cancellationToken = default)
DeleteAsync(long, IRedbUser)
Delete object by ID with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<bool> DeleteAsync(long objectId, IRedbUser user)
DeleteAsync(long)
Delete object by ID (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<bool> DeleteAsync(long objectId)
DeletePermissionAsync(IRedbPermission, IRedbUser?, CancellationToken)
Delete permission.
public Task<bool> DeletePermissionAsync(IRedbPermission permission, IRedbUser? currentUser = null, CancellationToken cancellationToken = default)
DeletePermissionAsync(IRedbPermission, IRedbUser?)
Delete permission.
public Task<bool> DeletePermissionAsync(IRedbPermission permission, IRedbUser? currentUser = null)
DeleteSubtreeAsync(IRedbObject, CancellationToken)
Delete object subtree recursively (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteSubtreeAsync(IRedbObject parentObj, CancellationToken cancellationToken = default)
DeleteSubtreeAsync(IRedbObject, IRedbUser, CancellationToken)
Delete object subtree recursively with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteSubtreeAsync(IRedbObject parentObj, IRedbUser user, CancellationToken cancellationToken = default)
DeleteSubtreeAsync(IRedbObject, IRedbUser)
Delete object subtree recursively with explicit user (uses config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteSubtreeAsync(IRedbObject parentObj, IRedbUser user)
DeleteSubtreeAsync(IRedbObject)
Delete object subtree recursively (uses _securityContext and config.DefaultCheckPermissionsOnDelete).
public Task<int> DeleteSubtreeAsync(IRedbObject parentObj)
DeleteSubtreeAsync(RedbObject, CancellationToken)
public Task<int> DeleteSubtreeAsync(RedbObject parentObj, CancellationToken cancellationToken = default)
DeleteSubtreeAsync(RedbObject, IRedbUser, CancellationToken)
public Task<int> DeleteSubtreeAsync(RedbObject parentObj, IRedbUser user, CancellationToken cancellationToken = default)
DeleteSubtreeAsync(RedbObject, IRedbUser)
public Task<int> DeleteSubtreeAsync(RedbObject parentObj, IRedbUser user)
DeleteSubtreeAsync(RedbObject)
public Task<int> DeleteSubtreeAsync(RedbObject parentObj)
DeleteWithPurgeAsync(IEnumerable<long>, int, IProgress<PurgeProgress>?, CancellationToken, long?)
Delete objects with background purge and progress reporting.
public Task DeleteWithPurgeAsync(IEnumerable<long> objectIds, int batchSize = 10, IProgress<PurgeProgress>? progress = null, CancellationToken cancellationToken = default, long? trashParentId = null)
EnsureDatabaseAsync()
Ensures the REDB database schema exists.
public virtual Task EnsureDatabaseAsync()
EnsureObjectSchemeAsync(string, CancellationToken)
Get or create scheme for Object type (without Props).
public Task<IRedbScheme> EnsureObjectSchemeAsync(string name, CancellationToken cancellationToken = default)
EnsureObjectSchemeAsync(string)
Get or create scheme for Object type (without Props).
public Task<IRedbScheme> EnsureObjectSchemeAsync(string name)
EnsurePvtModuleDeployedAsync()
Verifies that the v2-pvt SQL module is deployed at the version this
protected virtual Task EnsurePvtModuleDeployedAsync()
EnsureRootStructureKeyAsync()
Builds the unique key of root structures when it is missing, removing empty duplicates first. Called under the
protected Task EnsureRootStructureKeyAsync()
EnsureSchemeFromTypeAsync<TProps>()
Create/get scheme by name from Props type.
public Task<IRedbScheme> EnsureSchemeFromTypeAsync<TProps>() where TProps : class
EnsureSchemeFromTypeAsync<TProps>(CancellationToken)
Create/get scheme by name from Props type.
public Task<IRedbScheme> EnsureSchemeFromTypeAsync<TProps>(CancellationToken cancellationToken = default) where TProps : class
ExecuteSchemaScriptAsync(string)
Executes the full schema initialization SQL script against the database.
protected abstract Task ExecuteSchemaScriptAsync(string sql)
GetAllEffectivePermissionsAsync(IRedbUser, CancellationToken)
Get all effective user permissions.
public Task<List<EffectivePermissionResult>> GetAllEffectivePermissionsAsync(IRedbUser user, CancellationToken cancellationToken = default)
GetAllEffectivePermissionsAsync(IRedbUser)
Get all effective user permissions.
public Task<List<EffectivePermissionResult>> GetAllEffectivePermissionsAsync(IRedbUser user)
GetByUniqueAsync<TProps>(Expression<Func<TProps, object?>>, object?, int, CancellationToken)
The object whose [RedbUnique] property holds the given value, or null. One probe of the
public Task<RedbObject<TProps>?> GetByUniqueAsync<TProps>(Expression<Func<TProps, object?>> keyProperty, object? value, int depth = 10, CancellationToken cancellationToken = default) where TProps : class, new()
GetByUniqueAsync<TProps>(string, object?, int, CancellationToken)
The object whose [RedbUnique] property holds the given value, or null. One probe of the
public Task<RedbObject<TProps>?> GetByUniqueAsync<TProps>(string propertyName, object? value, int depth = 10, CancellationToken cancellationToken = default) where TProps : class, new()
GetChildrenAsync<TProps>(IRedbObject, CancellationToken)
Get direct children of object (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetChildrenAsync<TProps>(IRedbObject parentObj, CancellationToken cancellationToken = default) where TProps : class, new()
GetChildrenAsync<TProps>(IRedbObject, IRedbUser, CancellationToken)
Get direct children of object with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetChildrenAsync<TProps>(IRedbObject parentObj, IRedbUser user, CancellationToken cancellationToken = default) where TProps : class, new()
GetChildrenAsync<TProps>(IRedbObject, IRedbUser)
Get direct children of object with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetChildrenAsync<TProps>(IRedbObject parentObj, IRedbUser user) where TProps : class, new()
GetChildrenAsync<TProps>(IRedbObject)
Get direct children of object (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetChildrenAsync<TProps>(IRedbObject parentObj) where TProps : class, new()
GetDbVersionAsync(CancellationToken)
Asynchronously retrieves the database version using the provider-specific version SQL.
public Task<string?> GetDbVersionAsync(CancellationToken cancellationToken = default)
GetDeletionProgressAsync(long, CancellationToken)
Gets deletion progress for a specific trash container from database.
public Task<PurgeProgress?> GetDeletionProgressAsync(long trashId, CancellationToken cancellationToken = default)
GetDeletionProgressAsync(long)
Gets deletion progress for a specific trash container from database.
public Task<PurgeProgress?> GetDeletionProgressAsync(long trashId)
GetDescendantsAsync<TProps>(IRedbObject, int?, CancellationToken)
Get all object descendants (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetDescendantsAsync<TProps>(IRedbObject parentObj, int? maxDepth = null, CancellationToken cancellationToken = default) where TProps : class, new()
GetDescendantsAsync<TProps>(IRedbObject, int?)
Get all object descendants (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetDescendantsAsync<TProps>(IRedbObject parentObj, int? maxDepth = null) where TProps : class, new()
GetDescendantsAsync<TProps>(IRedbObject, IRedbUser, int?, CancellationToken)
Get all object descendants with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetDescendantsAsync<TProps>(IRedbObject parentObj, IRedbUser user, int? maxDepth = null, CancellationToken cancellationToken = default) where TProps : class, new()
GetDescendantsAsync<TProps>(IRedbObject, IRedbUser, int?)
Get all object descendants with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetDescendantsAsync<TProps>(IRedbObject parentObj, IRedbUser user, int? maxDepth = null) where TProps : class, new()
GetEffectivePermissionsAsync(IRedbUser, IRedbObject, CancellationToken)
Get effective user permissions for object (including inheritance and roles).
public Task<EffectivePermissionResult> GetEffectivePermissionsAsync(IRedbUser user, IRedbObject obj, CancellationToken cancellationToken = default)
GetEffectivePermissionsAsync(IRedbUser, IRedbObject)
Get effective user permissions for object (including inheritance and roles).
public Task<EffectivePermissionResult> GetEffectivePermissionsAsync(IRedbUser user, IRedbObject obj)
GetEffectivePermissionsBatchAsync(IRedbUser, IRedbObject[], CancellationToken)
Get effective user permissions for multiple objects (batch).
public Task<Dictionary<IRedbObject, EffectivePermissionResult>> GetEffectivePermissionsBatchAsync(IRedbUser user, IRedbObject[] objects, CancellationToken cancellationToken = default)
GetEffectivePermissionsBatchAsync(IRedbUser, IRedbObject[])
Get effective user permissions for multiple objects (batch).
public Task<Dictionary<IRedbObject, EffectivePermissionResult>> GetEffectivePermissionsBatchAsync(IRedbUser user, IRedbObject[] objects)
GetObjectJsonSql()
Get SQL for loading object as JSON. Override in derived classes for DB-specific syntax.
protected virtual string GetObjectJsonSql()
GetObjectSchemeAsync(string, CancellationToken)
Get scheme for Object type by name.
public Task<IRedbScheme?> GetObjectSchemeAsync(string name, CancellationToken cancellationToken = default)
GetObjectSchemeAsync(string)
Get scheme for Object type by name.
public Task<IRedbScheme?> GetObjectSchemeAsync(string name)
GetOrphanedDeletionTasksAsync(int, CancellationToken)
Gets orphaned deletion tasks for recovery at startup.
public Task<List<OrphanedTask>> GetOrphanedDeletionTasksAsync(int timeoutMinutes = 30, CancellationToken cancellationToken = default)
GetOrphanedDeletionTasksAsync(int)
Gets orphaned deletion tasks for recovery at startup.
public Task<List<OrphanedTask>> GetOrphanedDeletionTasksAsync(int timeoutMinutes = 30)
GetPathToRootAsync<TProps>(IRedbObject, CancellationToken)
Get path from object to root (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetPathToRootAsync<TProps>(IRedbObject obj, CancellationToken cancellationToken = default) where TProps : class, new()
GetPathToRootAsync<TProps>(IRedbObject, IRedbUser, CancellationToken)
Get path from object to root with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetPathToRootAsync<TProps>(IRedbObject obj, IRedbUser user, CancellationToken cancellationToken = default) where TProps : class, new()
GetPathToRootAsync<TProps>(IRedbObject, IRedbUser)
Get path from object to root with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetPathToRootAsync<TProps>(IRedbObject obj, IRedbUser user) where TProps : class, new()
GetPathToRootAsync<TProps>(IRedbObject)
Get path from object to root (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<IEnumerable<TreeRedbObject<TProps>>> GetPathToRootAsync<TProps>(IRedbObject obj) where TProps : class, new()
GetPermissionByIdAsync(long, CancellationToken)
Get permission by ID.
public Task<IRedbPermission?> GetPermissionByIdAsync(long permissionId, CancellationToken cancellationToken = default)
GetPermissionByIdAsync(long)
Get permission by ID.
public Task<IRedbPermission?> GetPermissionByIdAsync(long permissionId)
GetPermissionCountAsync(CancellationToken)
Get total permission count.
public Task<int> GetPermissionCountAsync(CancellationToken cancellationToken = default)
GetPermissionsByObjectAsync(IRedbObject, CancellationToken)
Get permissions for object.
public Task<List<IRedbPermission>> GetPermissionsByObjectAsync(IRedbObject obj, CancellationToken cancellationToken = default)
GetPermissionsByObjectAsync(IRedbObject)
Get permissions for object.
public Task<List<IRedbPermission>> GetPermissionsByObjectAsync(IRedbObject obj)
GetPermissionsByRoleAsync(IRedbRole, CancellationToken)
Get role permissions.
public Task<List<IRedbPermission>> GetPermissionsByRoleAsync(IRedbRole role, CancellationToken cancellationToken = default)
GetPermissionsByRoleAsync(IRedbRole)
Get role permissions.
public Task<List<IRedbPermission>> GetPermissionsByRoleAsync(IRedbRole role)
GetPermissionsByUserAsync(IRedbUser, CancellationToken)
Get user permissions.
public Task<List<IRedbPermission>> GetPermissionsByUserAsync(IRedbUser user, CancellationToken cancellationToken = default)
GetPermissionsByUserAsync(IRedbUser)
Get user permissions.
public Task<List<IRedbPermission>> GetPermissionsByUserAsync(IRedbUser user)
GetPolymorphicChildrenAsync(IRedbObject, CancellationToken)
Get all direct children of object regardless of their schemes.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicChildrenAsync(IRedbObject parentObj, CancellationToken cancellationToken = default)
GetPolymorphicChildrenAsync(IRedbObject, IRedbUser, CancellationToken)
Get all direct children of object regardless of their schemes with explicit user.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicChildrenAsync(IRedbObject parentObj, IRedbUser user, CancellationToken cancellationToken = default)
GetPolymorphicChildrenAsync(IRedbObject, IRedbUser)
Get all direct children of object regardless of their schemes with explicit user.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicChildrenAsync(IRedbObject parentObj, IRedbUser user)
GetPolymorphicChildrenAsync(IRedbObject)
Get all direct children of object regardless of their schemes.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicChildrenAsync(IRedbObject parentObj)
GetPolymorphicDescendantsAsync(IRedbObject, int?, CancellationToken)
Get all polymorphic descendants of object regardless of their schemes.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicDescendantsAsync(IRedbObject parentObj, int? maxDepth = null, CancellationToken cancellationToken = default)
GetPolymorphicDescendantsAsync(IRedbObject, int?)
Get all polymorphic descendants of object regardless of their schemes.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicDescendantsAsync(IRedbObject parentObj, int? maxDepth = null)
GetPolymorphicDescendantsAsync(IRedbObject, IRedbUser, int?, CancellationToken)
Get all polymorphic descendants of object with explicit user.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicDescendantsAsync(IRedbObject parentObj, IRedbUser user, int? maxDepth = null, CancellationToken cancellationToken = default)
GetPolymorphicDescendantsAsync(IRedbObject, IRedbUser, int?)
Get all polymorphic descendants of object with explicit user.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicDescendantsAsync(IRedbObject parentObj, IRedbUser user, int? maxDepth = null)
GetPolymorphicPathToRootAsync(IRedbObject, CancellationToken)
Get polymorphic path from object to root - objects can be of different schemes.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicPathToRootAsync(IRedbObject obj, CancellationToken cancellationToken = default)
GetPolymorphicPathToRootAsync(IRedbObject, IRedbUser, CancellationToken)
Get polymorphic path from object to root with explicit user.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicPathToRootAsync(IRedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
GetPolymorphicPathToRootAsync(IRedbObject, IRedbUser)
Get polymorphic path from object to root with explicit user.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicPathToRootAsync(IRedbObject obj, IRedbUser user)
GetPolymorphicPathToRootAsync(IRedbObject)
Get polymorphic path from object to root - objects can be of different schemes.
public Task<IEnumerable<ITreeRedbObject>> GetPolymorphicPathToRootAsync(IRedbObject obj)
GetReadableObjectIds()
Get IDs of objects readable by current user.
public IQueryable<long> GetReadableObjectIds()
GetReadableObjectIds(IRedbUser)
Get IDs of objects readable by user.
public IQueryable<long> GetReadableObjectIds(IRedbUser user)
GetRolePermissionCountAsync(IRedbRole, CancellationToken)
Get role permission count.
public Task<int> GetRolePermissionCountAsync(IRedbRole role, CancellationToken cancellationToken = default)
GetRolePermissionCountAsync(IRedbRole)
Get role permission count.
public Task<int> GetRolePermissionCountAsync(IRedbRole role)
GetSchemaScript()
Returns the full SQL script that creates the REDB schema.
public string GetSchemaScript()
GetSchemeAliasForType(Type)
Get scheme alias for C# class type.
public string? GetSchemeAliasForType(Type type)
GetSchemeAliasForType<TProps>()
Get scheme alias for C# class type.
public string? GetSchemeAliasForType<TProps>() where TProps : class
GetSchemeById(long)
Synchronous for the thread-pool-free load path (the synchronous
public IRedbScheme? GetSchemeById(long schemeId)
GetSchemeByIdAsync(long, CancellationToken)
Get scheme by ID.
public Task<IRedbScheme?> GetSchemeByIdAsync(long schemeId, CancellationToken cancellationToken = default)
GetSchemeByIdAsync(long)
Get scheme by ID.
public Task<IRedbScheme?> GetSchemeByIdAsync(long schemeId)
GetSchemeByNameAsync(string, CancellationToken)
Get scheme by name.
public Task<IRedbScheme?> GetSchemeByNameAsync(string schemeName, CancellationToken cancellationToken = default)
GetSchemeByNameAsync(string)
Get scheme by name.
public Task<IRedbScheme?> GetSchemeByNameAsync(string schemeName)
GetSchemeByTypeAsync(Type, CancellationToken)
Get scheme by C# class type.
public Task<IRedbScheme?> GetSchemeByTypeAsync(Type type, CancellationToken cancellationToken = default)
GetSchemeByTypeAsync(Type)
Get scheme by C# class type.
public Task<IRedbScheme?> GetSchemeByTypeAsync(Type type)
GetSchemeByTypeAsync<TProps>()
Get scheme by C# class type.
public Task<IRedbScheme?> GetSchemeByTypeAsync<TProps>() where TProps : class
GetSchemeByTypeAsync<TProps>(CancellationToken)
Get scheme by C# class type.
public Task<IRedbScheme?> GetSchemeByTypeAsync<TProps>(CancellationToken cancellationToken = default) where TProps : class
GetSchemeFromCache(string)
Get scheme from cache synchronously (no DB call).
public IRedbScheme? GetSchemeFromCache(string schemeName)
GetSchemeFromCache<TProps>()
Get scheme from cache synchronously (no DB call).
public IRedbScheme? GetSchemeFromCache<TProps>() where TProps : class
GetSchemeNameForType(Type)
Get scheme name for C# class type.
public string GetSchemeNameForType(Type type)
GetSchemeNameForType<TProps>()
Get scheme name for C# class type.
public string GetSchemeNameForType<TProps>() where TProps : class
GetSchemesAsync(CancellationToken)
Get all schemes.
public Task<List<IRedbScheme>> GetSchemesAsync(CancellationToken cancellationToken = default)
GetStructuresAsync(IRedbScheme, CancellationToken)
Get scheme structures.
public Task<List<IRedbStructure>> GetStructuresAsync(IRedbScheme scheme, CancellationToken cancellationToken = default)
GetStructuresAsync(IRedbScheme)
Get scheme structures.
public Task<List<IRedbStructure>> GetStructuresAsync(IRedbScheme scheme)
GetStructuresByTypeAsync(Type, CancellationToken)
Get scheme structures by C# class type.
public Task<List<IRedbStructure>> GetStructuresByTypeAsync(Type type, CancellationToken cancellationToken = default)
GetStructuresByTypeAsync(Type)
Get scheme structures by C# class type.
public Task<List<IRedbStructure>> GetStructuresByTypeAsync(Type type)
GetStructuresByTypeAsync<TProps>()
Get scheme structures by C# class type.
public Task<List<IRedbStructure>> GetStructuresByTypeAsync<TProps>() where TProps : class
GetStructuresByTypeAsync<TProps>(CancellationToken)
Get scheme structures by C# class type.
public Task<List<IRedbStructure>> GetStructuresByTypeAsync<TProps>(CancellationToken cancellationToken = default) where TProps : class
GetStructureTreeAsync(long, CancellationToken)
Get structure tree for scheme (cached).
public Task<List<StructureTreeNode>> GetStructureTreeAsync(long schemeId, CancellationToken cancellationToken = default)
GetStructureTreeAsync(long)
Get structure tree for scheme (cached).
public Task<List<StructureTreeNode>> GetStructureTreeAsync(long schemeId)
GetStructureTreeCacheStats()
Get structure tree cache statistics.
public (int TreesCount, int SubtreesCount, long MemoryEstimate) GetStructureTreeCacheStats()
GetSubtreeAsync(long, long?, CancellationToken)
Get subtree starting from parent structure (cached).
public Task<List<StructureTreeNode>> GetSubtreeAsync(long schemeId, long? parentStructureId, CancellationToken cancellationToken = default)
GetSubtreeAsync(long, long?)
Get subtree starting from parent structure (cached).
public Task<List<StructureTreeNode>> GetSubtreeAsync(long schemeId, long? parentStructureId)
GetSupportedTypesAsync()
Get all supported types.
public Task<List<SupportedType>> GetSupportedTypesAsync()
GetSupportedTypesAsync(CancellationToken)
Get all supported types.
public Task<List<SupportedType>> GetSupportedTypesAsync(CancellationToken cancellationToken = default)
GetUpgradeScript()
Returns the SQL script that brings an existing database up to the module version this
public string? GetUpgradeScript()
GetUserActiveDeletionsAsync(long, CancellationToken)
Gets all active (pending/running) deletions for a user from database.
public Task<List<PurgeProgress>> GetUserActiveDeletionsAsync(long userId, CancellationToken cancellationToken = default)
GetUserActiveDeletionsAsync(long)
Gets all active (pending/running) deletions for a user from database.
public Task<List<PurgeProgress>> GetUserActiveDeletionsAsync(long userId)
GetUserPermissionCountAsync(IRedbUser, CancellationToken)
Get user permission count.
public Task<int> GetUserPermissionCountAsync(IRedbUser user, CancellationToken cancellationToken = default)
GetUserPermissionCountAsync(IRedbUser)
Get user permission count.
public Task<int> GetUserPermissionCountAsync(IRedbUser user)
GrantPermissionAsync(IRedbRole, IRedbObject, PermissionAction, IRedbUser?, CancellationToken)
Grant permission to role.
public Task<bool> GrantPermissionAsync(IRedbRole role, IRedbObject obj, PermissionAction actions, IRedbUser? currentUser = null, CancellationToken cancellationToken = default)
GrantPermissionAsync(IRedbRole, IRedbObject, PermissionAction, IRedbUser?)
Grant permission to role.
public Task<bool> GrantPermissionAsync(IRedbRole role, IRedbObject obj, PermissionAction actions, IRedbUser? currentUser = null)
GrantPermissionAsync(IRedbUser, IRedbObject, PermissionAction, IRedbUser?, CancellationToken)
Grant permission to user.
public Task<bool> GrantPermissionAsync(IRedbUser user, IRedbObject obj, PermissionAction actions, IRedbUser? currentUser = null, CancellationToken cancellationToken = default)
GrantPermissionAsync(IRedbUser, IRedbObject, PermissionAction, IRedbUser?)
Grant permission to user.
public Task<bool> GrantPermissionAsync(IRedbUser user, IRedbObject obj, PermissionAction actions, IRedbUser? currentUser = null)
InitializeAsync(bool, params Assembly[])
Initialize REDB system at application startup, optionally creating the database schema first.
public Task InitializeAsync(bool ensureCreated, params Assembly[] assemblies)
InitializeAsync(params Assembly[])
Initialize REDB system at application startup.
public Task InitializeAsync(params Assembly[] assemblies)
InitializeTypeRegistryAsync()
Initialize AutomaticTypeRegistry for polymorphic operation support.
public Task InitializeTypeRegistryAsync()
InitializeTypeRegistryAsync(CancellationToken)
Initialize AutomaticTypeRegistry for polymorphic operation support.
public Task InitializeTypeRegistryAsync(CancellationToken cancellationToken = default)
InvalidateStructureTreeCache(long)
Invalidate structure tree cache for scheme.
public void InvalidateStructureTreeCache(long schemeId)
IsDatabaseClosedForSchemaWork(Exception)
Whether an error of the first look at the database means that another process holds it alone for schema work,
protected virtual bool IsDatabaseClosedForSchemaWork(Exception exception)
IsRootStructureKeyMissingAsync()
Whether the engine needs the unique key of root structures () and the
protected Task<bool> IsRootStructureKeyMissingAsync()
Load<TProps>(long, int)
Synchronous for the
public RedbObject<TProps>? Load<TProps>(long objectId, int depth = 10) where TProps : class, new()
LoadAsync(IEnumerable<long>, int, bool?)
Bulk polymorphic load of objects by ID (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<List<IRedbObject>> LoadAsync(IEnumerable<long> objectIds, int depth = 10, bool? lazyLoadProps = null)
LoadAsync(IEnumerable<long>, int, CancellationToken)
Bulk polymorphic load of objects by ID (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<List<IRedbObject>> LoadAsync(IEnumerable<long> objectIds, int depth = 10, CancellationToken cancellationToken = default)
LoadAsync(IEnumerable<long>, IRedbUser, int, bool?)
Bulk polymorphic load of objects by ID with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<List<IRedbObject>> LoadAsync(IEnumerable<long> objectIds, IRedbUser user, int depth = 10, bool? lazyLoadProps = null)
LoadAsync(IEnumerable<long>, IRedbUser, int, CancellationToken)
Bulk polymorphic load of objects by ID with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<List<IRedbObject>> LoadAsync(IEnumerable<long> objectIds, IRedbUser user, int depth = 10, CancellationToken cancellationToken = default)
LoadAsync<TProps>(IRedbObject, int, bool?)
Load object from EAV (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<RedbObject<TProps>?> LoadAsync<TProps>(IRedbObject obj, int depth = 10, bool? lazyLoadProps = null) where TProps : class, new()
LoadAsync<TProps>(IRedbObject, int, CancellationToken)
Load object from EAV (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<RedbObject<TProps>?> LoadAsync<TProps>(IRedbObject obj, int depth = 10, CancellationToken cancellationToken = default) where TProps : class, new()
LoadAsync<TProps>(IRedbObject, IRedbUser, int, bool?)
Load object from EAV with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<RedbObject<TProps>?> LoadAsync<TProps>(IRedbObject obj, IRedbUser user, int depth = 10, bool? lazyLoadProps = null) where TProps : class, new()
LoadAsync<TProps>(IRedbObject, IRedbUser, int, CancellationToken)
Load object from EAV with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<RedbObject<TProps>?> LoadAsync<TProps>(IRedbObject obj, IRedbUser user, int depth = 10, CancellationToken cancellationToken = default) where TProps : class, new()
LoadAsync<TProps>(long, int, bool?)
Load object from EAV by ID (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<RedbObject<TProps>?> LoadAsync<TProps>(long objectId, int depth = 10, bool? lazyLoadProps = null) where TProps : class, new()
LoadAsync<TProps>(long, int, CancellationToken)
Load object from EAV by ID (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<RedbObject<TProps>?> LoadAsync<TProps>(long objectId, int depth = 10, CancellationToken cancellationToken = default) where TProps : class, new()
LoadAsync<TProps>(long, IRedbUser, int, bool?)
Load object from EAV with explicit user by ID (uses config.DefaultCheckPermissionsOnLoad).
public Task<RedbObject<TProps>?> LoadAsync<TProps>(long objectId, IRedbUser user, int depth = 10, bool? lazyLoadProps = null) where TProps : class, new()
LoadAsync<TProps>(long, IRedbUser, int, CancellationToken)
Load object from EAV with explicit user by ID (uses config.DefaultCheckPermissionsOnLoad).
public Task<RedbObject<TProps>?> LoadAsync<TProps>(long objectId, IRedbUser user, int depth = 10, CancellationToken cancellationToken = default) where TProps : class, new()
LoadJsonAsync(long, int, CancellationToken)
Load the whole object as raw JSON by ID, without a CLR props type — the in-database
public Task<string?> LoadJsonAsync(long objectId, int depth = 10, CancellationToken cancellationToken = default)
LoadJsonAsync(long, IRedbUser, int, CancellationToken)
Load the whole object as raw JSON by ID with explicit user (see
public Task<string?> LoadJsonAsync(long objectId, IRedbUser user, int depth = 10, CancellationToken cancellationToken = default)
LoadLinkedObjectsAsync(IEnumerable<RedbListItem>, CancellationToken)
Loads the linked objects of items in one query on this service's connection, publishes them
public Task<IReadOnlyDictionary<long, IRedbObject>> LoadLinkedObjectsAsync(IEnumerable<RedbListItem> items, CancellationToken cancellationToken = default)
LoadPolymorphicTreeAsync(IRedbObject, int?, CancellationToken)
Load polymorphic tree/subtree - supports objects of different schemes in one tree.
public Task<ITreeRedbObject> LoadPolymorphicTreeAsync(IRedbObject rootObj, int? maxDepth = null, CancellationToken cancellationToken = default)
LoadPolymorphicTreeAsync(IRedbObject, int?)
Load polymorphic tree/subtree - supports objects of different schemes in one tree.
public Task<ITreeRedbObject> LoadPolymorphicTreeAsync(IRedbObject rootObj, int? maxDepth = null)
LoadPolymorphicTreeAsync(IRedbObject, IRedbUser, int?, CancellationToken)
Load polymorphic tree/subtree with explicit user.
public Task<ITreeRedbObject> LoadPolymorphicTreeAsync(IRedbObject rootObj, IRedbUser user, int? maxDepth = null, CancellationToken cancellationToken = default)
LoadPolymorphicTreeAsync(IRedbObject, IRedbUser, int?)
Load polymorphic tree/subtree with explicit user.
public Task<ITreeRedbObject> LoadPolymorphicTreeAsync(IRedbObject rootObj, IRedbUser user, int? maxDepth = null)
LoadReferencesAsync<TProps, TRef>(RedbObject<TProps>, Func<TProps, IEnumerable<RedbObject<TRef>?>?>, CancellationToken)
Loads a COLLECTION of reference stubs under a loaded parent in ONE batch query - the
public Task LoadReferencesAsync<TProps, TRef>(RedbObject<TProps> parent, Func<TProps, IEnumerable<RedbObject<TRef>?>?> references, CancellationToken cancellationToken = default) where TProps : class, new() where TRef : class, new()
LoadReferencesAsync<TProps, TRef>(RedbObject<TProps>, Func<TProps, RedbObject<TRef>?>, CancellationToken)
Single-reference form of .
public Task LoadReferencesAsync<TProps, TRef>(RedbObject<TProps> parent, Func<TProps, RedbObject<TRef>?> reference, CancellationToken cancellationToken = default) where TProps : class, new() where TRef : class, new()
LoadSchemeByTypeAsync(Type, CancellationToken)
Load scheme by C# class type (throws exception if not found).
public Task<IRedbScheme> LoadSchemeByTypeAsync(Type type, CancellationToken cancellationToken = default)
LoadSchemeByTypeAsync(Type)
Load scheme by C# class type (throws exception if not found).
public Task<IRedbScheme> LoadSchemeByTypeAsync(Type type)
LoadSchemeByTypeAsync<TProps>()
Load scheme by C# class type (throws exception if not found).
public Task<IRedbScheme> LoadSchemeByTypeAsync<TProps>() where TProps : class
LoadSchemeByTypeAsync<TProps>(CancellationToken)
Load scheme by C# class type (throws exception if not found).
public Task<IRedbScheme> LoadSchemeByTypeAsync<TProps>(CancellationToken cancellationToken = default) where TProps : class
LoadTreeAsync<TProps>(IRedbObject, int?, CancellationToken)
Load tree/subtree (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<TreeRedbObject<TProps>> LoadTreeAsync<TProps>(IRedbObject rootObj, int? maxDepth = null, CancellationToken cancellationToken = default) where TProps : class, new()
LoadTreeAsync<TProps>(IRedbObject, int?)
Load tree/subtree (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<TreeRedbObject<TProps>> LoadTreeAsync<TProps>(IRedbObject rootObj, int? maxDepth = null) where TProps : class, new()
LoadTreeAsync<TProps>(IRedbObject, IRedbUser, int?, CancellationToken)
Load tree/subtree with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<TreeRedbObject<TProps>> LoadTreeAsync<TProps>(IRedbObject rootObj, IRedbUser user, int? maxDepth = null, CancellationToken cancellationToken = default) where TProps : class, new()
LoadTreeAsync<TProps>(IRedbObject, IRedbUser, int?)
Load tree/subtree with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<TreeRedbObject<TProps>> LoadTreeAsync<TProps>(IRedbObject rootObj, IRedbUser user, int? maxDepth = null) where TProps : class, new()
LoadTreeAsync<TProps>(long, int?, CancellationToken)
Load tree/subtree by root object ID (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<TreeRedbObject<TProps>> LoadTreeAsync<TProps>(long rootObjectId, int? maxDepth = null, CancellationToken cancellationToken = default) where TProps : class, new()
LoadTreeAsync<TProps>(long, int?)
Load tree/subtree by root object ID (uses _securityContext and config.DefaultCheckPermissionsOnLoad).
public Task<TreeRedbObject<TProps>> LoadTreeAsync<TProps>(long rootObjectId, int? maxDepth = null) where TProps : class, new()
LoadTreeAsync<TProps>(long, IRedbUser, int?, CancellationToken)
Load tree/subtree by root object ID with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<TreeRedbObject<TProps>> LoadTreeAsync<TProps>(long rootObjectId, IRedbUser user, int? maxDepth = null, CancellationToken cancellationToken = default) where TProps : class, new()
LoadTreeAsync<TProps>(long, IRedbUser, int?)
Load tree/subtree by root object ID with explicit user (uses config.DefaultCheckPermissionsOnLoad).
public Task<TreeRedbObject<TProps>> LoadTreeAsync<TProps>(long rootObjectId, IRedbUser user, int? maxDepth = null) where TProps : class, new()
LockForUpdateAsync(long[], CancellationToken)
Acquire row-level locks on objects by id within the current transaction and report how
public Task<int> LockForUpdateAsync(long[] objectIds, CancellationToken cancellationToken)
LockForUpdateAsync(params long[])
Acquire row-level locks on objects by id within the current transaction and report how
public Task<int> LockForUpdateAsync(params long[] objectIds)
LockForUpdateRequiredAsync(long[], CancellationToken)
Strict form of for CAS patterns (lock -> re-read -> save):
public Task LockForUpdateRequiredAsync(long[] objectIds, CancellationToken cancellationToken)
LockForUpdateRequiredAsync(params long[])
Strict form of for CAS patterns (lock -> re-read -> save):
public Task LockForUpdateRequiredAsync(params long[] objectIds)
MigrateStructureTypeAsync(long, string, string, bool, CancellationToken)
Migrate data when changing structure type (e.g. String -> Long).
public Task<TypeMigrationResult> MigrateStructureTypeAsync(long structureId, string oldTypeName, string newTypeName, bool dryRun = false, CancellationToken cancellationToken = default)
MigrateStructureTypeAsync(long, string, string, bool)
Migrate data when changing structure type (e.g. String -> Long).
public Task<TypeMigrationResult> MigrateStructureTypeAsync(long structureId, string oldTypeName, string newTypeName, bool dryRun = false)
MoveObjectAsync(IRedbObject, IRedbObject?, CancellationToken)
Move object in tree (uses _securityContext and config.DefaultCheckPermissionsOnSave).
public Task MoveObjectAsync(IRedbObject obj, IRedbObject? newParentObj, CancellationToken cancellationToken = default)
MoveObjectAsync(IRedbObject, IRedbObject?, IRedbUser, CancellationToken)
Move object in tree with explicit user (uses config.DefaultCheckPermissionsOnSave).
public Task MoveObjectAsync(IRedbObject obj, IRedbObject? newParentObj, IRedbUser user, CancellationToken cancellationToken = default)
MoveObjectAsync(IRedbObject, IRedbObject?, IRedbUser)
Move object in tree with explicit user (uses config.DefaultCheckPermissionsOnSave).
public Task MoveObjectAsync(IRedbObject obj, IRedbObject? newParentObj, IRedbUser user)
MoveObjectAsync(IRedbObject, IRedbObject?)
Move object in tree (uses _securityContext and config.DefaultCheckPermissionsOnSave).
public Task MoveObjectAsync(IRedbObject obj, IRedbObject? newParentObj)
OpenSchemaLockAsync(CancellationToken)
The schema lock of this database, not yet taken (see ). A provider that has
protected abstract Task<SchemaLockHandle> OpenSchemaLockAsync(CancellationToken cancellationToken)
PurgeTrashAsync(long, int, int, IProgress<PurgeProgress>?, CancellationToken)
Purge a trash container created by SoftDeleteAsync.
public Task PurgeTrashAsync(long trashId, int totalCount, int batchSize = 10, IProgress<PurgeProgress>? progress = null, CancellationToken cancellationToken = default)
Query<TProps>()
Create type-safe query by type (synchronous).
public IRedbQueryable<TProps> Query<TProps>() where TProps : class, new()
Query<TProps>(IRedbUser)
Create type-safe query by type with specified user (synchronous).
public IRedbQueryable<TProps> Query<TProps>(IRedbUser user) where TProps : class, new()
ReadEmbeddedPvtBundleSql()
Returns the embedded v2-pvt module bundle (pvt_bundle.sql) or
protected virtual string? ReadEmbeddedPvtBundleSql()
ReadEmbeddedSql()
Reads the embedded combined SQL initialization script (redb_init.sql).
protected abstract string ReadEmbeddedSql()
RecomputeUniqueAsync<TProps>(string, CancellationToken)
Recompute the stored unique keys of one [RedbUnique] property and report duplicates
public Task<UniqueRecomputeReport> RecomputeUniqueAsync<TProps>(string propertyName, CancellationToken cancellationToken = default) where TProps : class
ResolvePasswordHasher()
Password hasher for the user provider: a DI registration wins, the fallback is bcrypt.
protected IPasswordHasher ResolvePasswordHasher()
ResolveSaveInterceptors()
Save-pipeline interceptors (discussion #12) handed to the storage provider: the DI registrations, resolved
protected RedbSaveInterceptorPipeline ResolveSaveInterceptors()
RevokeAllRolePermissionsAsync(IRedbRole, IRedbUser?, CancellationToken)
Revoke all role permissions.
public Task<int> RevokeAllRolePermissionsAsync(IRedbRole role, IRedbUser? currentUser = null, CancellationToken cancellationToken = default)
RevokeAllRolePermissionsAsync(IRedbRole, IRedbUser?)
Revoke all role permissions.
public Task<int> RevokeAllRolePermissionsAsync(IRedbRole role, IRedbUser? currentUser = null)
RevokeAllUserPermissionsAsync(IRedbUser, IRedbUser?, CancellationToken)
Revoke all user permissions.
public Task<int> RevokeAllUserPermissionsAsync(IRedbUser user, IRedbUser? currentUser = null, CancellationToken cancellationToken = default)
RevokeAllUserPermissionsAsync(IRedbUser, IRedbUser?)
Revoke all user permissions.
public Task<int> RevokeAllUserPermissionsAsync(IRedbUser user, IRedbUser? currentUser = null)
RevokePermissionAsync(IRedbRole, IRedbObject, IRedbUser?, CancellationToken)
Revoke permission from role.
public Task<bool> RevokePermissionAsync(IRedbRole role, IRedbObject obj, IRedbUser? currentUser = null, CancellationToken cancellationToken = default)
RevokePermissionAsync(IRedbRole, IRedbObject, IRedbUser?)
Revoke permission from role.
public Task<bool> RevokePermissionAsync(IRedbRole role, IRedbObject obj, IRedbUser? currentUser = null)
RevokePermissionAsync(IRedbUser, IRedbObject, IRedbUser?, CancellationToken)
Revoke permission from user.
public Task<bool> RevokePermissionAsync(IRedbUser user, IRedbObject obj, IRedbUser? currentUser = null, CancellationToken cancellationToken = default)
RevokePermissionAsync(IRedbUser, IRedbObject, IRedbUser?)
Revoke permission from user.
public Task<bool> RevokePermissionAsync(IRedbUser user, IRedbObject obj, IRedbUser? currentUser = null)
RunUnderSchemaLockAsync(Func<Task>, CancellationToken)
Runs work under the schema lock (). Reentrant: called
protected Task RunUnderSchemaLockAsync(Func<Task> work, CancellationToken cancellationToken = default)
SaveAsync(IEnumerable<IRedbObject>, CancellationToken)
Bulk save of polymorphic objects (uses _securityContext and config).
public Task<List<long>> SaveAsync(IEnumerable<IRedbObject> objects, CancellationToken cancellationToken = default)
SaveAsync(IEnumerable<IRedbObject>, IRedbUser, CancellationToken)
Bulk save of polymorphic objects with explicit user (uses config).
public Task<List<long>> SaveAsync(IEnumerable<IRedbObject> objects, IRedbUser user, CancellationToken cancellationToken = default)
SaveAsync(IEnumerable<IRedbObject>, IRedbUser)
Bulk save of polymorphic objects with explicit user (uses config).
public Task<List<long>> SaveAsync(IEnumerable<IRedbObject> objects, IRedbUser user)
SaveAsync(IEnumerable<IRedbObject>)
Bulk save of polymorphic objects (uses _securityContext and config).
public Task<List<long>> SaveAsync(IEnumerable<IRedbObject> objects)
SaveAsync(IRedbObject, CancellationToken)
Save object to EAV (uses _securityContext and config.DefaultCheckPermissionsOnSave).
public Task<long> SaveAsync(IRedbObject obj, CancellationToken cancellationToken = default)
SaveAsync(IRedbObject, IRedbUser, CancellationToken)
Save object to EAV with explicit user. Determines type internally.
public Task<long> SaveAsync(IRedbObject obj, IRedbUser user, CancellationToken cancellationToken = default)
SaveAsync(IRedbObject, IRedbUser)
Save object to EAV with explicit user. Determines type internally.
public Task<long> SaveAsync(IRedbObject obj, IRedbUser user)
SaveAsync(IRedbObject)
Save object to EAV (uses _securityContext and config.DefaultCheckPermissionsOnSave).
public Task<long> SaveAsync(IRedbObject obj)
SaveAsync<TProps>(IRedbObject<TProps>, CancellationToken)
Save generic object to EAV (uses _securityContext and config.DefaultCheckPermissionsOnSave).
public Task<long> SaveAsync<TProps>(IRedbObject<TProps> obj, CancellationToken cancellationToken = default) where TProps : class, new()
SaveAsync<TProps>(IRedbObject<TProps>, IRedbUser, CancellationToken)
Save generic object to EAV with explicit user (uses config.DefaultCheckPermissionsOnSave).
public Task<long> SaveAsync<TProps>(IRedbObject<TProps> obj, IRedbUser user, CancellationToken cancellationToken = default) where TProps : class, new()
SaveAsync<TProps>(IRedbObject<TProps>, IRedbUser)
Save generic object to EAV with explicit user (uses config.DefaultCheckPermissionsOnSave).
public Task<long> SaveAsync<TProps>(IRedbObject<TProps> obj, IRedbUser user) where TProps : class, new()
SaveAsync<TProps>(IRedbObject<TProps>)
Save generic object to EAV (uses _securityContext and config.DefaultCheckPermissionsOnSave).
public Task<long> SaveAsync<TProps>(IRedbObject<TProps> obj) where TProps : class, new()
SaveByUniqueAsync<TProps>(RedbObject<TProps>, CancellationToken)
Upsert by the object key (P1): resolves the _objects row by (scheme, ValueUnique) and
public Task<long> SaveByUniqueAsync<TProps>(RedbObject<TProps> obj, CancellationToken cancellationToken = default) where TProps : class, new()
SchemeExistsByNameAsync(string, CancellationToken)
Check if scheme exists by name.
public Task<bool> SchemeExistsByNameAsync(string schemeName, CancellationToken cancellationToken = default)
SchemeExistsByNameAsync(string)
Check if scheme exists by name.
public Task<bool> SchemeExistsByNameAsync(string schemeName)
SchemeExistsForTypeAsync(Type, CancellationToken)
Check if scheme exists for C# class type.
public Task<bool> SchemeExistsForTypeAsync(Type type, CancellationToken cancellationToken = default)
SchemeExistsForTypeAsync(Type)
Check if scheme exists for C# class type.
public Task<bool> SchemeExistsForTypeAsync(Type type)
SchemeExistsForTypeAsync<TProps>()
Check if scheme exists for C# class type.
public Task<bool> SchemeExistsForTypeAsync<TProps>() where TProps : class
SchemeExistsForTypeAsync<TProps>(CancellationToken)
Check if scheme exists for C# class type.
public Task<bool> SchemeExistsForTypeAsync<TProps>(CancellationToken cancellationToken = default) where TProps : class
SoftDeleteAsync(IEnumerable<IRedbObject>, IRedbUser, long?, CancellationToken)
Mark objects for soft-deletion with explicit user.
public Task<DeletionMark> SoftDeleteAsync(IEnumerable<IRedbObject> objects, IRedbUser user, long? trashParentId = null, CancellationToken cancellationToken = default)
SoftDeleteAsync(IEnumerable<IRedbObject>, IRedbUser, long?)
Mark objects for soft-deletion with explicit user.
public Task<DeletionMark> SoftDeleteAsync(IEnumerable<IRedbObject> objects, IRedbUser user, long? trashParentId = null)
SoftDeleteAsync(IEnumerable<IRedbObject>, long?, CancellationToken)
Mark objects for soft-deletion (uses _securityContext).
public Task<DeletionMark> SoftDeleteAsync(IEnumerable<IRedbObject> objects, long? trashParentId = null, CancellationToken cancellationToken = default)
SoftDeleteAsync(IEnumerable<IRedbObject>, long?)
Mark objects for soft-deletion (uses _securityContext).
public Task<DeletionMark> SoftDeleteAsync(IEnumerable<IRedbObject> objects, long? trashParentId = null)
SoftDeleteAsync(IEnumerable<long>, IRedbUser, long?, CancellationToken)
Mark objects for soft-deletion with explicit user.
public Task<DeletionMark> SoftDeleteAsync(IEnumerable<long> objectIds, IRedbUser user, long? trashParentId = null, CancellationToken cancellationToken = default)
SoftDeleteAsync(IEnumerable<long>, IRedbUser, long?)
Mark objects for soft-deletion with explicit user.
public Task<DeletionMark> SoftDeleteAsync(IEnumerable<long> objectIds, IRedbUser user, long? trashParentId = null)
SoftDeleteAsync(IEnumerable<long>, long?, CancellationToken)
Mark objects for soft-deletion (uses _securityContext).
public Task<DeletionMark> SoftDeleteAsync(IEnumerable<long> objectIds, long? trashParentId = null, CancellationToken cancellationToken = default)
SoftDeleteAsync(IEnumerable<long>, long?)
Mark objects for soft-deletion (uses _securityContext).
public Task<DeletionMark> SoftDeleteAsync(IEnumerable<long> objectIds, long? trashParentId = null)
SyncSchemeAsync<TProps>()
Simplified scheme synchronization method with auto-detection of name and alias.
public Task<IRedbScheme> SyncSchemeAsync<TProps>() where TProps : class
SyncSchemeAsync<TProps>(CancellationToken)
Simplified scheme synchronization method with auto-detection of name and alias.
public Task<IRedbScheme> SyncSchemeAsync<TProps>(CancellationToken cancellationToken = default) where TProps : class
SyncStructuresFromTypeAsync<TProps>(IRedbScheme, bool, CancellationToken)
Synchronize scheme structures from Props type (by default deletes extra fields).
public Task<List<IRedbStructure>> SyncStructuresFromTypeAsync<TProps>(IRedbScheme scheme, bool strictDeleteExtra = true, CancellationToken cancellationToken = default) where TProps : class
SyncStructuresFromTypeAsync<TProps>(IRedbScheme, bool)
Synchronize scheme structures from Props type (by default deletes extra fields).
public Task<List<IRedbStructure>> SyncStructuresFromTypeAsync<TProps>(IRedbScheme scheme, bool strictDeleteExtra = true) where TProps : class
TableExistsAsync(string)
Checks whether the specified table exists in the database.
protected abstract Task<bool> TableExistsAsync(string tableName)
TreeQuery<TProps>()
Create type-safe tree query by type (synchronous).
public IRedbQueryable<TProps> TreeQuery<TProps>() where TProps : class, new()
TreeQuery<TProps>(IEnumerable<IRedbObject>, int?)
Create tree query limited to subtrees of object list (synchronous).
public IRedbQueryable<TProps> TreeQuery<TProps>(IEnumerable<IRedbObject> rootObjects, int? maxDepth = null) where TProps : class, new()
TreeQuery<TProps>(IEnumerable<IRedbObject>, IRedbUser, int?)
Create tree query limited to subtrees of object list with specified user (synchronous).
public IRedbQueryable<TProps> TreeQuery<TProps>(IEnumerable<IRedbObject> rootObjects, IRedbUser user, int? maxDepth = null) where TProps : class, new()
TreeQuery<TProps>(IEnumerable<long>, int?)
Create tree query limited to subtrees by ID list (synchronous).
public IRedbQueryable<TProps> TreeQuery<TProps>(IEnumerable<long> rootObjectIds, int? maxDepth = null) where TProps : class, new()
TreeQuery<TProps>(IEnumerable<long>, IRedbUser, int?)
Create tree query limited to subtrees by ID list with specified user (synchronous).
public IRedbQueryable<TProps> TreeQuery<TProps>(IEnumerable<long> rootObjectIds, IRedbUser user, int? maxDepth = null) where TProps : class, new()
TreeQuery<TProps>(IRedbObject?, int?)
Create tree query limited to subtree (synchronous).
public IRedbQueryable<TProps> TreeQuery<TProps>(IRedbObject? rootObject, int? maxDepth = null) where TProps : class, new()
TreeQuery<TProps>(IRedbObject?, IRedbUser, int?)
Create tree query limited to subtree with specified user (synchronous).
public IRedbQueryable<TProps> TreeQuery<TProps>(IRedbObject? rootObject, IRedbUser user, int? maxDepth = null) where TProps : class, new()
TreeQuery<TProps>(IRedbUser)
Create type-safe tree query by type with specified user (synchronous).
public IRedbQueryable<TProps> TreeQuery<TProps>(IRedbUser user) where TProps : class, new()
TreeQuery<TProps>(long, int?)
Create tree query limited to subtree (synchronous, by ID).
public IRedbQueryable<TProps> TreeQuery<TProps>(long rootObjectId, int? maxDepth = null) where TProps : class, new()
TreeQuery<TProps>(long, IRedbUser, int?)
Create tree query limited to subtree with specified user (synchronous, by ID).
public IRedbQueryable<TProps> TreeQuery<TProps>(long rootObjectId, IRedbUser user, int? maxDepth = null) where TProps : class, new()
TryClaimOrphanedTaskAsync(long, int, CancellationToken)
Atomically claim an orphaned task for processing.
public Task<bool> TryClaimOrphanedTaskAsync(long trashId, int timeoutMinutes = 30, CancellationToken cancellationToken = default)
TryClaimOrphanedTaskAsync(long, int)
Atomically claim an orphaned task for processing.
public Task<bool> TryClaimOrphanedTaskAsync(long trashId, int timeoutMinutes = 30)
UpdateConfiguration(Action<RedbServiceConfiguration>)
Update configuration.
public void UpdateConfiguration(Action<RedbServiceConfiguration> configure)
UpdateConfiguration(Action<RedbServiceConfigurationBuilder>)
Update configuration via builder.
public void UpdateConfiguration(Action<RedbServiceConfigurationBuilder> configureBuilder)
UpdatePermissionAsync(IRedbPermission, PermissionRequest, IRedbUser?, CancellationToken)
Update permission.
public Task<IRedbPermission> UpdatePermissionAsync(IRedbPermission permission, PermissionRequest request, IRedbUser? currentUser = null, CancellationToken cancellationToken = default)
UpdatePermissionAsync(IRedbPermission, PermissionRequest, IRedbUser?)
Update permission.
public Task<IRedbPermission> UpdatePermissionAsync(IRedbPermission permission, PermissionRequest request, IRedbUser? currentUser = null)
ValidatePropertyConstraints(Type, string, bool, bool)
Validate property constraints and arrays.
public ValidationIssue? ValidatePropertyConstraints(Type propertyType, string propertyName, bool isRequired, bool isArray)
ValidateSchemaAsync<TProps>(IRedbScheme, bool, CancellationToken)
Validate schema before synchronization (with contract).
public Task<SchemaValidationResult> ValidateSchemaAsync<TProps>(IRedbScheme scheme, bool strictDeleteExtra = true, CancellationToken cancellationToken = default) where TProps : class
ValidateSchemaAsync<TProps>(IRedbScheme, bool)
Validate schema before synchronization (with contract).
public Task<SchemaValidationResult> ValidateSchemaAsync<TProps>(IRedbScheme scheme, bool strictDeleteExtra = true) where TProps : class
ValidateSchemaAsync<TProps>(string, bool, CancellationToken)
Validate schema before synchronization.
public Task<SchemaValidationResult> ValidateSchemaAsync<TProps>(string schemeName, bool strictDeleteExtra = true, CancellationToken cancellationToken = default) where TProps : class
ValidateSchemaAsync<TProps>(string, bool)
Validate schema before synchronization.
public Task<SchemaValidationResult> ValidateSchemaAsync<TProps>(string schemeName, bool strictDeleteExtra = true) where TProps : class
ValidateTypeAsync(Type, string, CancellationToken)
Validate C# type correspondence with REDB supported types.
public Task<ValidationIssue?> ValidateTypeAsync(Type csharpType, string propertyName, CancellationToken cancellationToken = default)
ValidateTypeAsync(Type, string)
Validate C# type correspondence with REDB supported types.
public Task<ValidationIssue?> ValidateTypeAsync(Type csharpType, string propertyName)
WarmupMetadataCacheAsync()
Warmup metadata cache. Override in derived classes for DB-specific SQL.
protected virtual Task WarmupMetadataCacheAsync()
WarnNewerOnce(string, string, string, ILogger?)
One warning per process for one newer module: every scoped service runs the start-up check.
protected static void WarnNewerOnce(string provider, string deployed, string own, ILogger? logger)
Constructors
RedbServiceBase(IServiceProvider)
Initialize RedbServiceBase with dependency injection.