/// <summary> /// Renders a content item from UMBRACO using a specified template id asyncronously /// </summary> /// <param name="QueryKey">unique Key for each content / template combination generate new guid for each call</param> /// <param name="id">The content identifier</param> /// <param name="templateid">the template id</param> /// <param name="bypassCache">if true will always return content from the server</param> public async Task <IHtmlString> GetItemWithSpecifiedTemplateAsync(int id, int templateid, bool bypassCache = false) { var altTempQ = new UmbracoAlternateTemplateQuery(associatedContentId: id, templateId: templateid); IHtmlString contentResponse = await QueryAsync(altTempQ, bypassCache).ConfigureAwait(false); return(contentResponse); }
/// <summary> /// Requests published content from umbraco asynchronously. With the option to bypass the local cache; always going to the server /// </summary> /// <param name="url">url to the content</param> /// <param name="templateid">the template id</param> /// <param name="bypassCache">if true will always return content from the server</param> /// <returns></returns> public async Task <IHtmlString> GetItemWithSpecifiedTemplateAsync(string url, int templateid, bool bypassCache = false) { var altTempQ = new UmbracoAlternateTemplateQuery(url: url, templateId: templateid, mappingQuery: GetPublishedContentIncludingMetadata); IHtmlString contentResponse = await QueryAsync(altTempQ, bypassCache).ConfigureAwait(false); return(contentResponse); }