public TemplateServiceConfiguration() { Activator = new DefaultActivator(); CompilerServiceFactory = #if RAZOR4 new Roslyn.RoslynCompilerServiceFactory(); #else new DefaultCompilerServiceFactory(); #endif EncodedStringFactory = new HtmlEncodedStringFactory(); #if !RAZOR4 #pragma warning disable 0618 // Backwards Compat. CodeInspectors = new List <ICodeInspector>(); #pragma warning restore 0618 // Backwards Compat. #endif ReferenceResolver = new UseCurrentAssembliesReferenceResolver(); CachingProvider = new DefaultCachingProvider(); TemplateManager = new DelegateTemplateManager(); Namespaces = new HashSet <string> { "System", "System.Collections.Generic", "System.Linq" }; var config = RazorEngineConfigurationSection.GetConfiguration(); Language = (config == null) ? Language.CSharp : config.DefaultLanguage; }
/// <summary> /// Initialises a new instance of <see cref="TemplateServiceConfiguration"/>. /// </summary> public TemplateServiceConfiguration() { Activator = new DefaultActivator(); CompilerServiceFactory = new DefaultCompilerServiceFactory(); EncodedStringFactory = new HtmlEncodedStringFactory(); CodeInspectors = new List <ICodeInspector>(); Namespaces = new HashSet <string> { "System", "System.Collections.Generic", "System.Linq" }; var config = RazorEngineConfigurationSection.GetConfiguration(); Language = (config == null) ? Language.CSharp : config.DefaultLanguage; }