public static RenderResult RenderTemplate(this ICakeContext ctx, string template, object data) { ctx = ctx ?? throw new ArgumentNullException(nameof(ctx)); var compiled = Hbs.Compile(template); return(new RenderResult(ctx, compiled(data))); }
public ITemplate <ViewModelOptions> Compile(string source) { return(new RenderTemplate { Template = HBS.Compile(source) }); }
public static Func <object, RenderResult> CompileTemplate(this ICakeContext ctx, string template) { ctx = ctx ?? throw new ArgumentNullException(nameof(ctx)); return(RenderResult.FromCompiledTemplate(ctx, Hbs.Compile(template))); }