Example #1
0
            public Func <object, string> CompileView(string templatePath)
            {
                var compiledView = _compiler.CompileView(templatePath);

                return((vm) =>
                {
                    var sb = new StringBuilder();
                    using (var tw = new StringWriter(sb))
                    {
                        compiledView(tw, vm);
                    }
                    return sb.ToString();
                });
            }
 public HandlebarsTemplate CompileView(string templateName, string parentTemplateName = null, bool throwOnErrors = true)
 {
     return(_compiler.CompileView(templateName, parentTemplateName, throwOnErrors));
 }