Example #1
0
 public static void RegisterNancyLiteRazor(this IServiceCollection services, NancyLiteRazorConfig config = null)
 {
     if (config == null)
     {
         services.AddSingleton(DefaultConfig);
     }
     else
     {
         services.AddSingleton(config);
     }
     services.AddSingleton <RazorEnginePlus>();
 }
Example #2
0
        public static void RegisterNancyLiteRazor(this IServiceCollection services, Action <RazorEngineCompilationOptionsBuilder> buildAction, IViewProvider viewProvider, ICompiledViewProvider compiledViewProvider)
        {
            var config = new NancyLiteRazorConfig
            {
                DefaultBuildAction   = buildAction,
                CompiledViewProvider = compiledViewProvider,
                RawViewProvider      = viewProvider
            };

            services.AddSingleton(config);
            services.AddSingleton <RazorEnginePlus>();
        }
Example #3
0
 public RazorEnginePlus(ILogger <RazorEnginePlus> iLogProvider, NancyLiteRazorConfig razorConfig)
 {
     logProvider = iLogProvider;
     config      = razorConfig;
 }