상속: IVeilContext
예제 #1
0
        public VeilGCBenchmarkCase()
        {
            var templateContents = Templates.ReadTemplate("Template.sshtml");
            var context = new VeilContext();
            context.RegisterTemplate("Master", Templates.ReadTemplate("Master.sshtml"));
            context.RegisterTemplate("Roles", Templates.ReadTemplate("Roles.sshtml"));
            var engine = new VeilEngine(context);

            template = engine.Compile<ViewModel>("sshtml", new StringReader(templateContents));
        }
        public VeilHandlebarsRenderSpeedBenchmarkCase()
        {
            var templateContents = Templates.ReadTemplate("Template.hbs");
            var context = new VeilContext();
            context.RegisterTemplate("Roles", Templates.ReadTemplate("Roles.hbs"));
            var engine = new VeilEngine(context);

            compiledTypedTemplate = engine.Compile<ViewModel>("hbs", new StringReader(templateContents));
            compiledUntypedTemplate = engine.CompileNonGeneric("hbs", new StringReader(templateContents), typeof(ViewModel));
            compiledDynamicTemplate = engine.Compile<dynamic>("hbs", new StringReader(templateContents));
            compiledDictionaryTemplate = engine.Compile<IDictionary<string, object>>("hbs", new StringReader(templateContents));
        }