Reacting to Mvc changes
This commit is contained in:
parent
7d7ecf3a1b
commit
9231dbda4f
|
|
@ -37,14 +37,19 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
|||
var mvcBuilderConfiguration = GetConfigureCompilationAction(configureCompilationType);
|
||||
var serviceProvider = GetProvider(mvcBuilderConfiguration);
|
||||
|
||||
CompilationService = (RazorCompilationService)serviceProvider.GetRequiredService<IRazorCompilationService>();
|
||||
Engine = serviceProvider.GetRequiredService<RazorEngine>();
|
||||
TemplateEngine = new MvcRazorTemplateEngine(Engine, serviceProvider.GetRequiredService<RazorProject>())
|
||||
{
|
||||
Options =
|
||||
{
|
||||
ImportsFileName = "_ViewImports.cshtml",
|
||||
}
|
||||
};
|
||||
Compiler = serviceProvider.GetRequiredService<CSharpCompiler>();
|
||||
ViewEngineOptions = serviceProvider.GetRequiredService<IOptions<RazorViewEngineOptions>>().Value;
|
||||
}
|
||||
|
||||
|
||||
public RazorCompilationService CompilationService { get; }
|
||||
public MvcRazorTemplateEngine TemplateEngine { get; }
|
||||
|
||||
public RazorEngine Engine { get; }
|
||||
|
||||
|
|
|
|||
|
|
@ -238,9 +238,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Internal
|
|||
var fileInfo = files[i];
|
||||
using (var fileStream = fileInfo.CreateReadStream())
|
||||
{
|
||||
var codeDocument = MvcServiceProvider.CompilationService.CreateCodeDocument(fileInfo.ViewEnginePath, fileStream);
|
||||
var result = MvcServiceProvider.CompilationService.ProcessCodeDocument(codeDocument);
|
||||
results[i] = new ViewCompilationInfo(fileInfo, result);
|
||||
var csharpDocument = MvcServiceProvider.TemplateEngine.GenerateCode(fileInfo.ViewEnginePath);
|
||||
results[i] = new ViewCompilationInfo(fileInfo, csharpDocument);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue