Class StructuredStoreGameProgressAdapter
IGameProgressStore implementation that translates load/save into calls against the generic IStructuredStore contract, via GameProgressRecordMapping. The single adapter every game-progress backend (key-value, HTTP, and any future Postgres/MySql/Mongo/Sqlite provider) shares.
Implements
Inherited Members
Namespace: Serenity.GameProgress.Infrastructure
Assembly: Serenity.GameProgress.Infrastructure.dll
Syntax
public class StructuredStoreGameProgressAdapter : IGameProgressStore
Remarks
Progress is a single, global row: SaveAsync(GameProgressData, CancellationToken) upserts it atomically, keyed on
PartitionKeyFields, replacing the row only when the
incoming UpdatedAtUtcTicks is strictly greater than the stored
one — the caller (GameProgressService)
guarantees strictly increasing ticks per save, so "strictly greater" always means "latest".
PersistenceStoreException and JsonParseException (a malformed
stored unlocked_extras payload) failures are re-wrapped as
GameProgressStoreException (itself a PersistenceStoreException)
so callers keep catching the game-progress-specific type; OperationCanceledException
always propagates unwrapped.
Constructors
StructuredStoreGameProgressAdapter(IStructuredStore, StoreTable, ILogService)
Initializes a new instance of the StructuredStoreGameProgressAdapter class.
Declaration
public StructuredStoreGameProgressAdapter(IStructuredStore store, StoreTable table, ILogService logService)
Parameters
| Type | Name | Description |
|---|---|---|
| IStructuredStore | store | The generic structured store backing every game-progress operation. |
| StoreTable | table | The table/collection game progress is stored in. |
| ILogService | logService | Logging service used to report failures. May be |
Methods
HealthCheckAsync(CancellationToken)
Declaration
public Task<bool> HealthCheckAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<bool> |
Remarks
Never throws — passes through to the underlying HealthCheckAsync(CancellationToken), itself a never-throw contract.
LoadAsync(CancellationToken)
Declaration
public Task<GameProgressData> LoadAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<GameProgressData> |
SaveAsync(GameProgressData, CancellationToken)
Declaration
public Task SaveAsync(GameProgressData data, CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| GameProgressData | data | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |