Exemplo n.º 1
0
        private void RegisterTemplate(HandlebarsDotNet.IHandlebars hbs, string name, string sourceFilename)
        {
            string fileName = System.Web.Hosting.HostingEnvironment.MapPath(sourceFilename);

            if (File.Exists(fileName))
            {
                using (var reader = new StreamReader(fileName))
                {
                    var partialTemplate = hbs.Compile(reader);
                    hbs.RegisterTemplate(name, partialTemplate);
                }
            }
        }