IStorage

Ecng.Serialization

Provides database storage operations for entities.

実装: IQueryContext

プロパティ

Stat
public Stat<string> Stat { get; }
value = iStorage.Stat

Gets the storage statistics.

メソッド

AddAsync``1
public ValueTask<TEntity> AddAsync<TEntity>(TEntity entity, CancellationToken cancellationToken)
result = iStorage.AddAsync(entity, cancellationToken)

Asynchronously adds a new entity to the storage.

AddBulkLoad``1
public void AddBulkLoad<TEntity>()
iStorage.AddBulkLoad()

Registers an entity type for bulk loading optimization.

AddCacheAsync``2
public ValueTask AddCacheAsync<TId, TEntity>(TId id, TEntity entity, CancellationToken cancellationToken)
result = iStorage.AddCacheAsync(id, entity, cancellationToken)

Asynchronously adds an entity to the cache.

ClearAsync``1
public ValueTask ClearAsync<TEntity>(CancellationToken cancellationToken)
result = iStorage.ClearAsync(cancellationToken)

Asynchronously removes all entities of the specified type from the storage.

ClearCacheAsync
public ValueTask ClearCacheAsync(CancellationToken cancellationToken)
result = iStorage.ClearCacheAsync(cancellationToken)

Asynchronously clears all cached entities.

CreateTransaction
public IStorageTransaction CreateTransaction()
result = iStorage.CreateTransaction()

Creates a new storage transaction.

GetByAsync``1
public ValueTask<TEntity> GetByAsync<TEntity>(IQueryable<TEntity> expression, CancellationToken cancellationToken)
result = iStorage.GetByAsync(expression, cancellationToken)

Asynchronously retrieves an entity matching the specified query expression.

GetByIdAsync``2
public ValueTask<TEntity> GetByIdAsync<TId, TEntity>(TId id, CancellationToken cancellationToken)
result = iStorage.GetByIdAsync(id, cancellationToken)

Asynchronously retrieves an entity by its primary key identifier.

GetByIdsAsync``2
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.

GetCountAsync``1
public ValueTask<long> GetCountAsync<TEntity>(CancellationToken cancellationToken)
result = iStorage.GetCountAsync(cancellationToken)

Asynchronously returns the total count of entities of the specified type.

GetGroupAsync``1
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.

RemoveAsync``1
public ValueTask<bool> RemoveAsync<TEntity>(TEntity entity, CancellationToken cancellationToken)
result = iStorage.RemoveAsync(entity, cancellationToken)

Asynchronously removes an entity from the storage.

UpdateAsync``1
public ValueTask<TEntity> UpdateAsync<TEntity>(TEntity entity, CancellationToken cancellationToken)
result = iStorage.UpdateAsync(entity, cancellationToken)

Asynchronously updates an existing entity in the storage.