Beispiel #1
0
        public static string FileToString(string templatePath, object data)
        {
            string template = File.ReadAllText(templatePath);
            FileSystemTemplateLocator templateLocator = GetTemplateLocator(templatePath);

            return(StringToString(template, data, templateLocator.GetTemplate));
        }
Beispiel #2
0
        public static void FileToFile(string templatePath, object data, string outputPath, Options options)
        {
            var reader = new StringReader(File.ReadAllText(templatePath));
            FileSystemTemplateLocator templateLocator = GetTemplateLocator(templatePath);

            using (StreamWriter writer = File.CreateText(outputPath))
            {
                Template(reader, data, writer, templateLocator.GetTemplate, options);
            }
        }