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
optionsPersistenceOptions
Properties
Accounts
Gets the account repository.
public IAccountRepository Accounts { get; }
Property Value
Items
Gets the item repository.
public IItemRepository Items { get; }
Property Value
Mobiles
Gets the mobile repository.
public IMobileRepository Mobiles { get; }
Property Value
Methods
AllocateNextAccountId()
Allocates the next progressive account serial identifier.
public Serial AllocateNextAccountId()
Returns
AllocateNextItemId()
Allocates the next progressive item serial identifier.
public Serial AllocateNextItemId()
Returns
AllocateNextMobileId()
Allocates the next progressive mobile serial identifier.
public Serial AllocateNextMobileId()
Returns
InitializeAsync(CancellationToken)
Loads state from snapshot and replays journal entries.
public ValueTask InitializeAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
SaveSnapshotAsync(CancellationToken)
Writes a new snapshot and resets the journal.
public ValueTask SaveSnapshotAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken