Table of Contents

Interface IPersistManyAction<TItem>

Namespace
FishMMO.Database.Npgsql.Services.Interfaces.Actions
Assembly
FishMMO-DB.dll

Defines a persist operation for a collection.

public interface IPersistManyAction<TItem>

Type Parameters

TItem

The item type being persisted.

Remarks

Intended for service interfaces that expose batch persistence semantics. Implementations should be careful to preserve idempotency under execution-strategy retries.

Methods

PersistAsync(IEnumerable<TItem>, CancellationToken)

Persists the provided items.

Task<DatabaseResult<BulkWriteResult>> PersistAsync(IEnumerable<TItem> items, CancellationToken cancellationToken = default)

Parameters

items IEnumerable<TItem>

Items to persist.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<DatabaseResult<BulkWriteResult>>

What the write actually did, or a failure.

Remarks

A successful result does not mean every supplied row was written. Batched writes are version-gated and the service filters what it cannot act on, so the outcome carries counts rather than a bare boolean — see BulkWriteResult, which explains which discrepancies a caller should care about and which are routine.