Table of Contents

Interface IContentService

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

Methods

ClearCacheAsync()

Task ClearCacheAsync()

Returns

Task

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 (ContentSource) — server, cache, stale cache or 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>

Remarks

A default implementation is provided so adding this member does not break existing implementers of this public interface. It delegates to GetContentAsync(string, string, Guid, ContentFormat?, string, IReadOnlyDictionary<string, string>) and reports Unknown rather than inventing a provenance it cannot know. The built-in implementation overrides it with the real source.

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

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

Parameters

key string
value string
languageKey Guid
contentType ContentFormat
application string

Returns

Task