public static async Task <string> GetTermsAndConditions(this KenticoClient kenticoClient_) { var content = new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("elements.contentid", "content-terms-and-conditions") }; try { JObject result = await kenticoClient_.Get("items", content); JArray items = (JArray)result["items"]; JToken privacyPolicy = items[0]; JToken privacyPolicyElements = privacyPolicy["elements"]; return(privacyPolicyElements["body"]["value"].Value <string>()); } catch { return(null); } }
public PrivacyModel(ILogger <PrivacyModel> logger, KenticoClient kenticoClient) { _logger = logger; _kenticoClient = kenticoClient; }
public WebsiteController(IOptions <KenticoOptions> optionsAccessor, KenticoClient kenticoClient) { _options = optionsAccessor.Value ?? new KenticoOptions(); _kenticoClient = kenticoClient; }