Interface IContentService
public interface IContentService
Methods
ClearCacheAsync()
Task ClearCacheAsync()
Returns
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
keystringdefaultValuestringlanguageKeyGuidcontentTypeContentFormat?applicationstringtranslationsIReadOnlyDictionary<string, string>
Returns
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
keystringdefaultValuestringlanguageKeyGuidcontentTypeContentFormat?applicationstringtranslationsIReadOnlyDictionary<string, string>
Returns
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
keystringvaluestringlanguageKeyGuidcontentTypeContentFormatapplicationstring