Пример #1
0
        public void ConfigureServices(IServiceCollection services)
        {
            var fileProvider = new UpdateableFileProvider();

            services.AddSingleton(fileProvider);

            services.AddMvc()
            .AddRazorRuntimeCompilation(options => options.FileProviders.Add(fileProvider));
        }
Пример #2
0
 public IActionResult UpdateRazorPages([FromServices] UpdateableFileProvider fileProvider)
 {
     fileProvider.CancelRazorPages();
     return(Ok());
 }
Пример #3
0
 public IActionResult Update([FromServices] UpdateableFileProvider fileProvider, string path, string content)
 {
     fileProvider.UpdateContent(path, content);
     return(Ok());
 }