常用方法
常用方法
常用方法
常用方法
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); }