From bca294e6e84f03b600e643e2e3e6b86f2613caf6 Mon Sep 17 00:00:00 2001 From: Troy Dai Date: Tue, 28 Apr 2015 00:07:34 -0700 Subject: [PATCH] React to ICompileModule change --- .../PrecompilationTagHelperDescriptorResolver.cs | 6 +++--- .../Precompilation/RazorPreCompiler.cs | 5 ++--- src/Microsoft.AspNet.Mvc/RazorPreCompileModule.cs | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.AspNet.Mvc.Razor/Precompilation/PrecompilationTagHelperDescriptorResolver.cs b/src/Microsoft.AspNet.Mvc.Razor/Precompilation/PrecompilationTagHelperDescriptorResolver.cs index 67d436341f..fe0cbdec0e 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Precompilation/PrecompilationTagHelperDescriptorResolver.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Precompilation/PrecompilationTagHelperDescriptorResolver.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation public class PrecompilationTagHelperTypeResolver : TagHelperTypeResolver { private static readonly string TagHelperTypeName = typeof(ITagHelper).FullName; - private readonly IBeforeCompileContext _compileContext; + private readonly BeforeCompileContext _compileContext; private readonly IAssemblyLoadContext _loadContext; private object _compilationLock = new object(); private bool _assemblyEmited; @@ -29,9 +29,9 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation /// /// Initializes a new instance of . /// - /// The . + /// The . /// The . - public PrecompilationTagHelperTypeResolver([NotNull] IBeforeCompileContext compileContext, + public PrecompilationTagHelperTypeResolver([NotNull] BeforeCompileContext compileContext, [NotNull] IAssemblyLoadContext loadContext) { _compileContext = compileContext; diff --git a/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs b/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs index de0d78f3fd..af0e482d3d 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs @@ -24,7 +24,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation public class RazorPreCompiler { public RazorPreCompiler( - [NotNull] IBeforeCompileContext compileContext, + [NotNull] BeforeCompileContext compileContext, [NotNull] IAssemblyLoadContextAccessor loadContextAccessor, [NotNull] IFileProvider fileProvider, [NotNull] IMemoryCache precompilationCache, @@ -45,7 +45,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation protected IFileProvider FileProvider { get; } - protected IBeforeCompileContext CompileContext { get; } + protected BeforeCompileContext CompileContext { get; } protected IAssemblyLoadContext LoadContext { get; } @@ -62,7 +62,6 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation public virtual void CompileViews() { var result = CreateFileInfoCollection(); - if (result != null) { var collectionGenerator = new RazorFileInfoCollectionGenerator( diff --git a/src/Microsoft.AspNet.Mvc/RazorPreCompileModule.cs b/src/Microsoft.AspNet.Mvc/RazorPreCompileModule.cs index 8046a2aaa5..49b9822127 100644 --- a/src/Microsoft.AspNet.Mvc/RazorPreCompileModule.cs +++ b/src/Microsoft.AspNet.Mvc/RazorPreCompileModule.cs @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Mvc /// /// Pre-compiles all Razor views in the application. - public virtual void BeforeCompile(IBeforeCompileContext context) + public virtual void BeforeCompile(BeforeCompileContext context) { var compilerOptionsProvider = _appServices.GetRequiredService(); var loadContextAccessor = _appServices.GetRequiredService(); @@ -61,13 +61,13 @@ namespace Microsoft.AspNet.Mvc } /// - public void AfterCompile(IAfterCompileContext context) + public void AfterCompile(AfterCompileContext context) { } private static CompilationSettings GetCompilationSettings( ICompilerOptionsProvider compilerOptionsProvider, - IProjectContext projectContext) + ProjectContext projectContext) { return compilerOptionsProvider.GetCompilerOptions(projectContext.Name, projectContext.TargetFramework,