Esempio n. 1
0
        public void WithEngine()
        {
            var engine = new TemplatingEngine();
            var host   = new TemplateGenerator();

            host.Refs.Add("System.CodeDom");

            var session = host.GetOrCreateSession();

            session["Count"] = 2;

            var templateString = File.ReadAllText("RuntimeTextTemplateForEngine.tt");

            string output = engine.ProcessTemplate(templateString, host);

            Console.WriteLine(output);
        }