Table of Contents

Class PersistenceUnitOfWork

Namespace
Moongate.Persistence.Services.Persistence
Assembly
Moongate.Persistence.dll

Coordinates repositories plus snapshot/journal load-save lifecycle.

public sealed class PersistenceUnitOfWork : IPersistenceUnitOfWork
Inheritance
PersistenceUnitOfWork
Implements
Inherited Members

Constructors

PersistenceUnitOfWork(PersistenceOptions)

public PersistenceUnitOfWork(PersistenceOptions options)

Parameters

options PersistenceOptions

Properties

Accounts

Gets the account repository.

public IAccountRepository Accounts { get; }

Property Value

IAccountRepository

Items

Gets the item repository.

public IItemRepository Items { get; }

Property Value

IItemRepository

Mobiles

Gets the mobile repository.

public IMobileRepository Mobiles { get; }

Property Value

IMobileRepository

Methods

AllocateNextAccountId()

Allocates the next progressive account serial identifier.

public Serial AllocateNextAccountId()

Returns

Serial

AllocateNextItemId()

Allocates the next progressive item serial identifier.

public Serial AllocateNextItemId()

Returns

Serial

AllocateNextMobileId()

Allocates the next progressive mobile serial identifier.

public Serial AllocateNextMobileId()

Returns

Serial

InitializeAsync(CancellationToken)

Loads state from snapshot and replays journal entries.

public ValueTask InitializeAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask

SaveSnapshotAsync(CancellationToken)

Writes a new snapshot and resets the journal.

public ValueTask SaveSnapshotAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

ValueTask