Table of Contents

Class StartupTemplateService

Namespace
Moongate.UO.Data.Services.Templates
Assembly
Moongate.UO.Data.dll

Thread-safe startup template store keyed by template identifier.

public sealed class StartupTemplateService : IStartupTemplateService
Inheritance
StartupTemplateService
Implements
Inherited Members

Properties

Count

Gets the number of startup template documents currently registered.

public int Count { get; }

Property Value

int

Methods

Clear()

Removes all registered startup templates.

public void Clear()

GetAll()

Returns all startup templates as a snapshot.

public IReadOnlyList<StartupTemplateDocument> GetAll()

Returns

IReadOnlyList<StartupTemplateDocument>

List of currently registered startup templates.

TryGet(string, out StartupTemplateDocument?)

Tries to get a startup template by identifier.

public bool TryGet(string id, out StartupTemplateDocument? document)

Parameters

id string

Template identifier.

document StartupTemplateDocument

Resolved document when present.

Returns

bool

true when found; otherwise false.

Upsert(string, JsonElement)

Adds or replaces a startup template payload by identifier.

public void Upsert(string id, JsonElement content)

Parameters

id string

Template identifier.

content JsonElement

Template JSON payload.