Table of Contents

Interface IRemoteContentCallService

Namespace
Quilt4Net.Toolkit.Features.Content
Assembly
Quilt4Net.Toolkit.dll
public interface IRemoteContentCallService

Methods

ClearContentCacheAsync()

Task ClearContentCacheAsync()

Returns

Task

GetCacheCountsByLanguage()

Number of currently-cached content entries grouped by language key — i.e. how much content has been loaded so far per language (warm-up + lazy loads). For diagnostics/admin display.

IReadOnlyDictionary<Guid, int> GetCacheCountsByLanguage()

Returns

IReadOnlyDictionary<Guid, int>

GetContentAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>)

Task<(string Value, bool Success)> GetContentAsync(string key, string defaultValue, Guid languageKey, ContentFormat? contentType, string application = null, IReadOnlyDictionary<string, string> translations = null)

Parameters

key string
defaultValue string
languageKey Guid
contentType ContentFormat?
application string
translations IReadOnlyDictionary<string, string>

Returns

Task<(string Value, bool Success)>

GetContentResultAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>)

As GetContentAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>), but also reports where the value came from. Prefer this when the caller needs to tell a server value apart from a cached one or a fallback default.

Task<ContentResult> GetContentResultAsync(string key, string defaultValue, Guid languageKey, ContentFormat? contentType, string application = null, IReadOnlyDictionary<string, string> translations = null)

Parameters

key string
defaultValue string
languageKey Guid
contentType ContentFormat?
application string
translations IReadOnlyDictionary<string, string>

Returns

Task<ContentResult>

GetLanguagesAsync(bool)

Task<Language[]> GetLanguagesAsync(bool forceReload)

Parameters

forceReload bool

Returns

Task<Language[]>

SetContentAsync(string, string, Guid, ContentFormat, string)

Task SetContentAsync(string key, string defaultValue, Guid languageKey, ContentFormat contentType, string application = null)

Parameters

key string
defaultValue string
languageKey Guid
contentType ContentFormat
application string

Returns

Task

WarmCacheAsync(Guid, string)

Pre-fill the local cache for an entire application + language in one bulk call (the startup warm-up). Eliminates the per-key fan-out on cold load. Best-effort: a missing endpoint (old server, 404), failure, or timeout is swallowed so the normal per-key path still serves content. application follows the usual convention (null → resolve).

Task WarmCacheAsync(Guid languageKey, string application = null)

Parameters

languageKey Guid
application string

Returns

Task

WarmConfiguredLanguagesAsync(string)

Warm the default language plus every language named in WarmUpLanguages in one bulk call each. Used by the startup warm-up and by "Reload Content". A configured name with no matching server language is skipped with a Warning. Best-effort throughout, like WarmCacheAsync(Guid, string).

Task WarmConfiguredLanguagesAsync(string application = null)

Parameters

application string

Returns

Task