From 05f5d59e4408bca8ecd5679b68317e06f16d88b8 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Thu, 6 Jul 2017 19:43:42 -0700 Subject: [PATCH] Fix build break --- .../Internal/RazorViewCompiler.cs | 2 +- .../RazorViewEngine.cs | 4 ++-- .../PageActionDescriptorChangeProvider.cs | 2 +- .../Internal/PageActionInvokerProvider.cs | 2 +- .../RazorProjectPageRouteModelProvider.cs | 2 +- .../Internal/FileProviderRazorProjectTest.cs | 22 +++++++++---------- .../PageDirectiveFeatureTest.cs | 2 +- .../TestRazorCompilationService.cs | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorViewCompiler.cs b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorViewCompiler.cs index e5412f5aae..0a031b8cba 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorViewCompiler.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/Internal/RazorViewCompiler.cs @@ -180,7 +180,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal compilationTaskSource = new TaskCompletionSource(); foreach (var importItem in _templateEngine.GetImportItems(projectItem)) { - cacheEntryOptions.ExpirationTokens.Add(_fileProvider.Watch(importItem.Path)); + cacheEntryOptions.ExpirationTokens.Add(_fileProvider.Watch(importItem.FilePath)); } cacheEntry = compilationTaskSource.Task; } diff --git a/src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngine.cs b/src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngine.cs index da6ef0d766..be5c345966 100644 --- a/src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngine.cs +++ b/src/Microsoft.AspNetCore.Mvc.Razor/RazorViewEngine.cs @@ -432,7 +432,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor foreach (var viewStartProjectItem in _razorProject.FindHierarchicalItems(path, ViewStartFileName)) { - var result = _pageFactory.CreateFactory(viewStartProjectItem.Path); + var result = _pageFactory.CreateFactory(viewStartProjectItem.FilePath); var viewDescriptor = result.ViewDescriptor; if (viewDescriptor?.ExpirationTokens != null) { @@ -447,7 +447,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor // Populate the viewStartPages list so that _ViewStarts appear in the order the need to be // executed (closest last, furthest first). This is the reverse order in which // ViewHierarchyUtility.GetViewStartLocations returns _ViewStarts. - viewStartPages.Insert(0, new ViewLocationCacheItem(result.RazorPageFactory, viewStartProjectItem.Path)); + viewStartPages.Insert(0, new ViewLocationCacheItem(result.RazorPageFactory, viewStartProjectItem.FilePath)); } } diff --git a/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/PageActionDescriptorChangeProvider.cs b/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/PageActionDescriptorChangeProvider.cs index 635de93e85..949cf71395 100644 --- a/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/PageActionDescriptorChangeProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/PageActionDescriptorChangeProvider.cs @@ -47,7 +47,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal var importFileAtPagesRoot = rootDirectory + "/" + templateEngine.Options.ImportsFileName; _additionalFilesToTrack = templateEngine.GetImportItems(importFileAtPagesRoot) - .Select(item => item.Path) + .Select(item => item.FilePath) .ToArray(); _searchPattern = rootDirectory + "/**/*.cshtml"; diff --git a/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/PageActionInvokerProvider.cs b/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/PageActionInvokerProvider.cs index ff9863135c..ab0afacf9d 100644 --- a/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/PageActionInvokerProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/PageActionInvokerProvider.cs @@ -212,7 +212,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal ViewStartFileName); foreach (var item in viewStartItems) { - var factoryResult = _razorPageFactoryProvider.CreateFactory(item.Path); + var factoryResult = _razorPageFactoryProvider.CreateFactory(item.FilePath); if (factoryResult.Success) { viewStartFactories.Insert(0, factoryResult.RazorPageFactory); diff --git a/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/RazorProjectPageRouteModelProvider.cs b/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/RazorProjectPageRouteModelProvider.cs index 3b27adf383..d6e50480d6 100644 --- a/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/RazorProjectPageRouteModelProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.RazorPages/Internal/RazorProjectPageRouteModelProvider.cs @@ -49,7 +49,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal var routeModel = new PageRouteModel( relativePath: item.CombinedPath, - viewEnginePath: item.PathWithoutExtension); + viewEnginePath: item.FilePathWithoutExtension); PageSelectorModel.PopulateDefaults(routeModel, routeTemplate); context.RouteModels.Add(routeModel); diff --git a/test/Microsoft.AspNetCore.Mvc.Razor.Test/Internal/FileProviderRazorProjectTest.cs b/test/Microsoft.AspNetCore.Mvc.Razor.Test/Internal/FileProviderRazorProjectTest.cs index 644c9888f6..eaf215ec67 100644 --- a/test/Microsoft.AspNetCore.Mvc.Razor.Test/Internal/FileProviderRazorProjectTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.Razor.Test/Internal/FileProviderRazorProjectTest.cs @@ -48,9 +48,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal var razorFiles = razorProject.EnumerateItems("/"); // Assert - Assert.Collection(razorFiles.OrderBy(f => f.Path), - file => Assert.Equal("/File1.cshtml", file.Path), - file => Assert.Equal("/File3.cshtml", file.Path)); + Assert.Collection(razorFiles.OrderBy(f => f.FilePath), + file => Assert.Equal("/File1.cshtml", file.FilePath), + file => Assert.Equal("/File3.cshtml", file.FilePath)); } [Fact] @@ -89,11 +89,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal var razorFiles = razorProject.EnumerateItems("/"); // Assert - Assert.Collection(razorFiles.OrderBy(f => f.Path), - file => Assert.Equal("/File1.cshtml", file.Path), - file => Assert.Equal("/Level1-Dir1/File2.cshtml", file.Path), - file => Assert.Equal("/Level1-Dir1/File3.cshtml", file.Path), - file => Assert.Equal("/Level1-Dir2/File5.cshtml", file.Path)); + Assert.Collection(razorFiles.OrderBy(f => f.FilePath), + file => Assert.Equal("/File1.cshtml", file.FilePath), + file => Assert.Equal("/Level1-Dir1/File2.cshtml", file.FilePath), + file => Assert.Equal("/Level1-Dir1/File3.cshtml", file.FilePath), + file => Assert.Equal("/Level1-Dir2/File5.cshtml", file.FilePath)); } [Fact] @@ -132,9 +132,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal var razorFiles = razorProject.EnumerateItems("/Level1-Dir1"); // Assert - Assert.Collection(razorFiles.OrderBy(f => f.Path), - file => Assert.Equal("/File2.cshtml", file.Path), - file => Assert.Equal("/File3.cshtml", file.Path)); + Assert.Collection(razorFiles.OrderBy(f => f.FilePath), + file => Assert.Equal("/File2.cshtml", file.FilePath), + file => Assert.Equal("/File3.cshtml", file.FilePath)); } } } diff --git a/test/Microsoft.AspNetCore.Mvc.RazorPages.Test/Infrastructure/PageDirectiveFeatureTest.cs b/test/Microsoft.AspNetCore.Mvc.RazorPages.Test/Infrastructure/PageDirectiveFeatureTest.cs index 596847d5a6..9b713fab29 100644 --- a/test/Microsoft.AspNetCore.Mvc.RazorPages.Test/Infrastructure/PageDirectiveFeatureTest.cs +++ b/test/Microsoft.AspNetCore.Mvc.RazorPages.Test/Infrastructure/PageDirectiveFeatureTest.cs @@ -170,7 +170,7 @@ Nobody will use it"); public override bool Exists => throw new NotImplementedException(); - public override string Path => "Test.cshtml"; + public override string FilePath => "Test.cshtml"; public override string PhysicalPath => null; diff --git a/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs b/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs index f2844a0d3c..44cd35fd9e 100644 --- a/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs +++ b/test/WebSites/RazorPageExecutionInstrumentationWebSite/TestRazorCompilationService.cs @@ -24,7 +24,7 @@ namespace RazorPageExecutionInstrumentationWebSite private class TestRazorProjectItem : FileProviderRazorProjectItem { public TestRazorProjectItem(FileProviderRazorProjectItem projectItem) - : base(projectItem.FileInfo, projectItem.BasePath, projectItem.Path) + : base(projectItem.FileInfo, projectItem.BasePath, projectItem.FilePath) { }