public async Task <string> RenderTemplateForModel <K>(string liquidTemplatePath, K model) { //Put some caching mechanism here. var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Pages", liquidTemplatePath); var template = new FluidParser().Parse(await File.ReadAllTextAsync(path)); return(await template.RenderAsync(new TemplateContext(model, _templateOptions).SetValue(typeof(K).Name, model))); }