IStorage
Provides database storage operations for entities.
Реализует: IQueryContext
Свойства
Методы
public ValueTask<TEntity> AddAsync<TEntity>(TEntity entity, CancellationToken cancellationToken)
result = iStorage.AddAsync(entity, cancellationToken)
Asynchronously adds a new entity to the storage.
public void AddBulkLoad<TEntity>()
iStorage.AddBulkLoad()
Registers an entity type for bulk loading optimization.
public ValueTask AddCacheAsync<TId, TEntity>(TId id, TEntity entity, CancellationToken cancellationToken)
result = iStorage.AddCacheAsync(id, entity, cancellationToken)
Asynchronously adds an entity to the cache.
public ValueTask ClearAsync<TEntity>(CancellationToken cancellationToken)
result = iStorage.ClearAsync(cancellationToken)
Asynchronously removes all entities of the specified type from the storage.
public ValueTask ClearCacheAsync(CancellationToken cancellationToken)
result = iStorage.ClearCacheAsync(cancellationToken)
Asynchronously clears all cached entities.
public IStorageTransaction CreateTransaction()
result = iStorage.CreateTransaction()
Creates a new storage transaction.
public ValueTask<TEntity> GetByAsync<TEntity>(IQueryable<TEntity> expression, CancellationToken cancellationToken)
result = iStorage.GetByAsync(expression, cancellationToken)
Asynchronously retrieves an entity matching the specified query expression.
public ValueTask<TEntity> GetByIdAsync<TId, TEntity>(TId id, CancellationToken cancellationToken)
result = iStorage.GetByIdAsync(id, cancellationToken)
Asynchronously retrieves an entity by its primary key identifier.
public ValueTask<TEntity[]> GetByIdsAsync<TId, TEntity>(IEnumerable<TId> ids, CancellationToken cancellationToken)
result = iStorage.GetByIdsAsync(ids, cancellationToken)
Asynchronously retrieves multiple entities by their primary key identifiers using a single IN query. Results are returned in the same order as input . Duplicate input ids produce duplicate entries in the result. IDs not found in the database are silently skipped.
public ValueTask<long> GetCountAsync<TEntity>(CancellationToken cancellationToken)
result = iStorage.GetCountAsync(cancellationToken)
Asynchronously returns the total count of entities of the specified type.
public ValueTask<TEntity[]> GetGroupAsync<TEntity>(long startIndex, long count, bool deleted, string orderBy, ListSortDirection direction, CancellationToken cancellationToken)
result = iStorage.GetGroupAsync(startIndex, count, deleted, orderBy, direction, cancellationToken)
Asynchronously retrieves a paged group of entities with sorting.
public ValueTask<bool> RemoveAsync<TEntity>(TEntity entity, CancellationToken cancellationToken)
result = iStorage.RemoveAsync(entity, cancellationToken)
Asynchronously removes an entity from the storage.
public ValueTask<TEntity> UpdateAsync<TEntity>(TEntity entity, CancellationToken cancellationToken)
result = iStorage.UpdateAsync(entity, cancellationToken)
Asynchronously updates an existing entity in the storage.