From b79f8384b0c90bdb5bd648b67675b4f3aefc939e Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Mon, 30 Jan 2017 13:46:27 -0800 Subject: [PATCH] Make some methods public for ViewCompilation. --- .../Internal/RazorCompilationService.cs | 6 ++++-- .../TestRazorCompilationService.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorCompilationService.cs b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorCompilationService.cs index e9d3da7338..512b6227eb 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorCompilationService.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorCompilationService.cs @@ -71,6 +71,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal _globalImports = RazorSourceDocument.ReadFrom(stream, filename: null, encoding: Encoding.UTF8); } + + /// public CompilationResult Compile(RelativeFileInfo file) { @@ -101,7 +103,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal return _compilationService.Compile(codeDocument, cSharpDocument); } - protected virtual RazorCodeDocument CreateCodeDocument(string relativePath, Stream inputStream) + public virtual RazorCodeDocument CreateCodeDocument(string relativePath, Stream inputStream) { var absolutePath = _fileProvider.GetFileInfo(relativePath)?.PhysicalPath ?? relativePath; @@ -128,7 +130,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal return RazorCodeDocument.Create(source, imports); } - protected virtual RazorCSharpDocument ProcessCodeDocument(RazorCodeDocument codeDocument) + public virtual RazorCSharpDocument ProcessCodeDocument(RazorCodeDocument codeDocument) { _engine.Process(codeDocument); diff --git a/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs b/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs index 729ce64d7f..17482281e1 100644 --- a/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs +++ b/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs @@ -22,7 +22,7 @@ namespace RazorPageExecutionInstrumentationWebSite { } - protected override RazorCodeDocument CreateCodeDocument(string relativePath, Stream inputStream) + public override RazorCodeDocument CreateCodeDocument(string relativePath, Stream inputStream) { // Normalize line endings to '\r\n' (CRLF). This removes core.autocrlf, core.eol, core.safecrlf, and // .gitattributes from the equation and treats "\r\n" and "\n" as equivalent. Does not handle