public WebPagesRouter(IHostingEnvironment hostingEnvironment, RazorViewToStringRenderer renderer, WebPagesOptions opts) { if (opts == null) throw new ArgumentNullException(nameof(opts)); _hostingEnvironment = hostingEnvironment; _renderer = renderer; _opts = opts; }
public WebPagesRouter(IHostingEnvironment hostingEnvironment, RazorViewToStringRenderer renderer, WebPagesOptions opts) { if (opts == null) { throw new ArgumentNullException(nameof(opts)); } _hostingEnvironment = hostingEnvironment; _renderer = renderer; _opts = opts; }
public WebPagesRouter(IHostingEnvironment hostingEnvironment, RazorViewToStringRenderer renderer, WebPagesOptions opts, IRazorViewEngineFileProviderAccessor fileProviderAccessor) { if (opts == null) { throw new ArgumentNullException(nameof(opts)); } _hostingEnvironment = hostingEnvironment; _renderer = renderer; _opts = opts; _fileProviderAccessor = fileProviderAccessor; }
public static void AddWebPages(this IServiceCollection services, WebPagesOptions webPagesOptions) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.AddMvcCore().AddRazorViewEngine(o => { o.ViewLocationFormats.Clear(); o.ViewLocationFormats.Add("/" + webPagesOptions.ViewsFolderName + "/{0}" + RazorViewEngine.ViewExtension); }); services.AddSingleton<WebPagesOptions>(webPagesOptions); services.AddSingleton<RazorViewToStringRenderer>(); services.AddSingleton<WebPagesRouter>(); }
public static void AddWebPages(this IServiceCollection services, WebPagesOptions webPagesOptions) { if (services == null) { throw new ArgumentNullException(nameof(services)); } services.AddMvcCore().AddRazorViewEngine(o => { o.ViewLocationFormats.Clear(); o.ViewLocationFormats.Add("/" + webPagesOptions.ViewsFolderName + "/{0}" + RazorViewEngine.ViewExtension); }); services.AddSingleton <WebPagesOptions>(webPagesOptions); services.AddSingleton <RazorViewToStringRenderer>(); services.AddSingleton <WebPagesRouter>(); }