Μετάβαση στο περιεχόμενο

ICommandRepository

Αυτό το περιεχόμενο δεν είναι ακόμη διαθέσιμο στη γλώσσα σου.

Defined in: packages/core/application/ports/command-repository.port.ts:18

Contract for write-side command repositories.

Persists an entity or aggregate state into persistence storage.

constructor(private readonly users: ICommandRepository<User, UserSnapshot>) {}
await this.users.save(user);

TEntity = unknown

The aggregate entity or payload being persisted.

TResult = unknown

The result type returned after persistence (or null on deletion).

save(entity): Promise<TResult | null>

Defined in: packages/core/application/ports/command-repository.port.ts:25

Persists the aggregate/payload.

Returning null is the conventional deletion result used by the DDD cache decorator to trigger eviction/barrier behavior.

TEntity

Promise<TResult | null>