logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class StructuredStoreGameSaveAdapter

    IGameSaveStore implementation that translates load/save/delete/query into calls against the generic IStructuredStore contract, via GameSaveRecordMapping. The single adapter every game-save backend (key-value, HTTP, and any future Postgres/MySql/Mongo/Sqlite provider) shares.

    Inheritance
    object
    StructuredStoreGameSaveAdapter
    Implements
    IGameSaveStore
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.GameSave.Infrastructure
    Assembly: Serenity.GameSave.Infrastructure.dll
    Syntax
    public class StructuredStoreGameSaveAdapter : IGameSaveStore
    Remarks

    Each slot is its own row within the shared GlobalPartitionValue partition (see GameSaveRecordMapping's remarks): SaveAsync(SaveSlotId, SaveDocument, CancellationToken) upserts it atomically, keyed on KeyFieldsPartitionAndSlot, replacing the row only when the incoming SavedAtUtcTicks is strictly greater than the stored one — the caller (GameSaveService) guarantees strictly increasing ticks per slot, so "strictly greater" always means "latest". PersistenceStoreException and JsonParseException (a malformed stored payload) failures are re-wrapped as GameSaveStoreException (itself a PersistenceStoreException) so callers keep catching the game-save-specific type; OperationCanceledException always propagates unwrapped.

    Constructors

    StructuredStoreGameSaveAdapter(IStructuredStore, StoreTable, ILogService)

    Initializes a new instance of the StructuredStoreGameSaveAdapter class.

    Declaration
    public StructuredStoreGameSaveAdapter(IStructuredStore store, StoreTable table, ILogService logService)
    Parameters
    Type Name Description
    IStructuredStore store

    The generic structured store backing every game-save operation.

    StoreTable table

    The table/collection game saves are stored in.

    ILogService logService

    Logging service used to report failures. May be null.

    Methods

    DeleteAsync(SaveSlotId, CancellationToken)

    Declaration
    public Task DeleteAsync(SaveSlotId slotId, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    SaveSlotId slotId
    CancellationToken cancellationToken
    Returns
    Type Description
    Task

    ExistsAsync(SaveSlotId, CancellationToken)

    Declaration
    public Task<bool> ExistsAsync(SaveSlotId slotId, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    SaveSlotId slotId
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<bool>

    GetSlotSummaryAsync(SaveSlotId, CancellationToken)

    Declaration
    public Task<SaveSlotSummary> GetSlotSummaryAsync(SaveSlotId slotId, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    SaveSlotId slotId
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<SaveSlotSummary>

    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(SaveSlotId, CancellationToken)

    Declaration
    public Task<SaveDocument> LoadAsync(SaveSlotId slotId, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    SaveSlotId slotId
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<SaveDocument>

    QuerySummariesAsync(CancellationToken)

    Declaration
    public Task<IReadOnlyList<SaveSlotSummary>> QuerySummariesAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IReadOnlyList<SaveSlotSummary>>

    SaveAsync(SaveSlotId, SaveDocument, CancellationToken)

    Declaration
    public Task SaveAsync(SaveSlotId slotId, SaveDocument document, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    SaveSlotId slotId
    SaveDocument document
    CancellationToken cancellationToken
    Returns
    Type Description
    Task

    Implements

    IGameSaveStore
    In this article
    © 2026 Serenity. All Rights Reserved