示例#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));
        }
示例#2
0
        public VeilHandlebarsRenderSpeedBenchmarkCase()
        {
            var templateContents = Templates.ReadTemplate("Template.haml");
            var context          = new VeilContext();

            context.RegisterTemplate("Roles", Templates.ReadTemplate("Roles.haml"));
            var engine = new VeilEngine(context);

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