private async Task RenderPageCoreAsync(ITemplatePage page, PageContext context) { page.PageContext = context; page.IncludeFunc = async(key, model) => { ITemplatePage template = await _engineHandler.CompileTemplateAsync(key); await _engineHandler.RenderIncludedTemplateAsync(template, model, context.Writer, context.ViewBag, this); }; //_pageActivator.Activate(page, context); await page.ExecuteAsync().ConfigureAwait(false); }
/// <summary> /// Search and compile a template with a given key /// </summary> /// <param name="key">Unique key of the template</param> /// <param name="compileIfNotCached">If true - it will try to get a template with a specified key and compile it</param> /// <returns>An instance of a template</returns> public Task <ITemplatePage> CompileTemplateAsync(string key) { return(_handler.CompileTemplateAsync(key)); }
/// <summary> /// Search and compile a template with a given key /// </summary> /// <param name="key">Unique key of the template</param> /// <param name="compileIfNotCached">If true - it will try to get a template with a specified key and compile it</param> /// <returns>An instance of a template</returns> public Task <ITemplatePage> CompileTemplateAsync(string key, bool isEncoding = false) { return(_handler.CompileTemplateAsync(key, isEncoding)); }