Beispiel #1
0
        /// <summary>
        /// Sets the razor provider used for compiling templates.
        /// </summary>
        /// <param name="provider">The razor provider.</param>
        public static void SetRazorProvider(IRazorProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            Compiler = new RazorCompiler(provider);
        }
Beispiel #2
0
 /// <summary>
 /// Statically initialises the <see cref="Razor"/> type.
 /// </summary>
 static Razor()
 {
     Compiler  = new RazorCompiler(new CSharpRazorProvider());
     Templates = new Dictionary <string, ITemplate>();
 }